home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / dbase / vpi1manl.zip / PART3.MAN < prev    next >
Text File  |  1991-12-25  |  283KB  |  9,064 lines

  1.      VP-Info Level 1 Reference Manual           Page 226          SECTION 4
  2.  
  3.  
  4.  
  5.                                       FIND
  6.  
  7.      Find a record by its index in the selected data file.
  8.  
  9.      ╔════════════════════════════════════════════════════════════════════╗
  10.      ║ FIND <string>                                                      ║
  11.      ╚════════════════════════════════════════════════════════════════════╝
  12.  
  13.           FIND is one of a family of commands that finds a record in an
  14.      indexed data file by matching a given string with key values in the
  15.      index file:
  16.  
  17.           FIND positions the file on the first record in the index matching
  18.                the FIND string (no-find positions the file at the top of
  19.                file)
  20.           LAST positions the file on the last record in the index matching
  21.                the FIND string (VP-Info Professional only) (no-find
  22.                positions the file at the top of file)
  23.           NEAREST positions the file on the first record in the index equal
  24.                to or greater than the FIND string (VP-Info Professional
  25.                only)
  26.           SEEK is identical to FIND, except that it searches for the match
  27.                to the value of a character expression instead of a string
  28.                constant (VP-Info Professional only) (no-find positions the
  29.                file at the top of file)
  30.  
  31.           All forms allow a search to be made on a character expression
  32.      when the expression is preceded by the macro symbol "&".  When the
  33.      variable var='TAYLOR', all of the following command lines are
  34.      equivalent:
  35.  
  36.      FIND TAYLOR
  37.      FIND &var
  38.      SEEK var            (VP-Info Professional only)
  39.  
  40.           In Conversational VP-Info Level 1, just type FIND and the key.
  41.  
  42.           Examples:
  43.  
  44.      1>FIND TAYLOR
  45.      1>FIND TOM
  46.  
  47.           If <string> evaluates the same for two records, the second record
  48.      will never be found with FIND.
  49.  
  50.           If SET DELETE ON, deleted records will not be found.  (See the
  51.      command SET.)
  52.  
  53.           Numbers must always be treated as strings, even if the key
  54.      expression is a numeric field.  If NUM is a numeric field of width 2,
  55.      FIND 1 will not find 1, but FIND &STR(1,2) or FIND &' 1' will work.
  56.  
  57.  
  58.      FIND                       VPI1  VPI  VPIN                        FIND      VP-Info Level 1 Reference Manual           Page 227          SECTION 4
  59.  
  60.  
  61.           For the users' convenience, Conversational VP-Info Level 1
  62.      converts all command lines to upper case before execution.  So, to
  63.      find the inventory numbers that start with AB, type either of the
  64.      following two commands:
  65.  
  66.      1>FIND AB
  67.      1>FIND ab
  68.  
  69.           It follows that
  70.  
  71.      1>FIND Taylor
  72.  
  73.      is understood by VP-Info Level 1 as FIND TAYLOR.  If you have to find
  74.      Taylor, use one of the following forms:
  75.  
  76.      1>FIND &'Taylor'
  77.      1>SEEK 'Taylor'        (VP-Info Professional only)
  78.  
  79.      or if name='Taylor' use one of the following forms:
  80.  
  81.      1>FIND &name
  82.      1>SEEK name            (VP-Info Professional only)
  83.  
  84.           In a Level 1 program, put the key in a memory variable <memvar>
  85.      and then use FIND &<memvar> to find the record.
  86.  
  87.           Example:
  88.  
  89.      name='Taylor'
  90.      FIND &name
  91.  
  92.           If FIND is successful, the value of the current record pointer
  93.      (as shown by the # and RECNO( functions) is set to the current record
  94.      number, and the system variable :NEAR is set to the same number.
  95.  
  96.           If the record is not found, the current record pointer will be
  97.      set to 0 and the value of :NEAR will be set to the number of the first
  98.      record in the index with a key greater than the FIND string; if the
  99.      index contains no key greater than the FIND string, :NEAR is set to
  100.      the bottom of file, and EOF is set to T (true).
  101.  
  102.           The command for "if not found" is:
  103.  
  104.      IF #=0 or
  105.      IF RECNO()=0
  106.  
  107.           In Conversational VP-Info Level 1 or in programs with SET TALK
  108.      ON, VP-Info Level 1 sends the message "NO FIND" when a search is
  109.      unsuccessful.
  110.  
  111.      Notes:
  112.  
  113.           * FIND only works on the active index of the selected data file.
  114.  
  115.      FIND                       VPI1  VPI  VPIN                        FIND      VP-Info Level 1 Reference Manual           Page 228          SECTION 4
  116.  
  117.  
  118.                If that index was created with a selection condition, some
  119.                records may be excluded from the index. (See INDEX.)
  120.  
  121.           * With SET EXACT ON (see the SET command) only exact matches are
  122.                found.  The FIND string must be the same length as the index
  123.                key, and match exactly;  if SET EXACT OFF, the find string
  124.                may be shorter.
  125.  
  126.           * An index may be made insensitive to capitalization by using the
  127.                uppercase functions !( or UPPER( in index creation.  This
  128.                makes use of the FIND command much easier in Conversational
  129.                VP-Info Level 1. (See INDEX command.)
  130.  
  131.           * The macro symbol (&) has a wider definition when used with
  132.                FIND, LAST, NEAREST and SEEK than with other VP-Info Level 1
  133.                command.  With this group of commands only, it alerts
  134.                VP-Info Level 1 that the string expression following is to
  135.                be evaluated and used as the FIND string.  (Macros in all
  136.                other commands are limited to fields and variables;
  137.                dimensioned variables, functions and concatenation are not
  138.                allowed.)
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.      FIND                       VPI1  VPI  VPIN                        FIND      VP-Info Level 1 Reference Manual           Page 229          SECTION 4
  173.  
  174.  
  175.  
  176.                                      FLUSH
  177.  
  178.      Update the selected data file on the disk.
  179.  
  180.      ╔════════════════════════════════════════════════════════════════════╗
  181.      ║ FLUSH                                                              ║
  182.      ╚════════════════════════════════════════════════════════════════════╝
  183.  
  184.           The current record of the selected data file is updated on the
  185.      disk.  This may prevent accidental loss of data due to power failure.
  186.  
  187.           This command updates only the selected data file; it does not
  188.      update other data files in use, nor does it safeguard index files,
  189.      text files, or DOS files.  After a power failure it may be necessary
  190.      to reindex the selected file.
  191.  
  192.           Example:
  193.  
  194.      1>FLUSH
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.      FLUSH                      VPI1  VPI  VPIN                       FLUSH      VP-Info Level 1 Reference Manual           Page 230          SECTION 4
  230.  
  231.  
  232.  
  233.  
  234.  
  235.      Declare global variables.
  236.  
  237.      ╔════════════════════════════════════════════════════════════════════╗
  238.      ║ GLOBAL <memvar list>                                               ║
  239.      ║                                                                    ║
  240.      ║ <memvar list>  the list of memory variables to be declared global  ║
  241.      ╚════════════════════════════════════════════════════════════════════╝
  242.  
  243.           When a program is chained to another program, all the variables
  244.      that were defined as global by the GLOBAL command will be passed to
  245.      the new program.
  246.  
  247.           The GLOBAL command should be the first command of any program.
  248.      It should definitely precede any command that involves a memory
  249.      variable.
  250.  
  251.           There can be only one GLOBAL command in a program.  No part of
  252.      the GLOBAL command can be a macro.  A matrix variable cannot occur in
  253.      a GLOBAL command.
  254.  
  255.           This is how the command works.  In PROG1, you find at the
  256.      beginning
  257.  
  258.      GLOBAL a,b,c,d
  259.  
  260.      This places in the memory variable table (in the internal
  261.      VP-Info Level 1 data space, see Appendix A) the variable names: A, B,
  262.      C, D, in that order.  The variables at this stage have no type or
  263.      data.  When in PROG1, A is encountered, that will attach type and a
  264.      pointer to a value to A.
  265.  
  266.           Now PROG1 is chained to PROG2.  For PROG2 to receive the values
  267.      associated in PROG1 with A, B, C, and D, start with the command:
  268.  
  269.      GLOBAL a,b,c,d
  270.  
  271.      Note, however, that the variable names do not have to match (although
  272.      type must).
  273.  
  274.      GLOBAL x,y,c,d
  275.  
  276.      will create the variable X with the contents of A, Y with the contents
  277.      of B, C and D retain their names and types.
  278.  
  279.           If you start PROG2 with
  280.  
  281.      GLOBAL a,b,c
  282.  
  283.      then A, B, and C are inherited.  If you specify in PROG2 more global
  284.      variables, for instance,
  285.  
  286.      GLOBAL                     VPI1  VPI  VPIN                      GLOBAL      VP-Info Level 1 Reference Manual           Page 231          SECTION 4
  287.  
  288.  
  289.  
  290.      GLOBAL a,b,c,d,e
  291.  
  292.      then A, B, C, and D inherit their values and types from PROG1; E
  293.      becomes the fifth entry in the memory variable table, with no type or
  294.      value.
  295.  
  296.           Example:
  297.  
  298.           PROG1 is chained to PROG2 with the command:
  299.  
  300.      CHAIN PROG2
  301.  
  302.           PROG1 wants to pass to PROG2 the values of the following
  303.      variables: TRANSACT, PROCESS, CUSTRANGE, TYPE.  To accomplish this,
  304.      start both PROG1 and PROG2 with the command:
  305.  
  306.      GLOBAL transact,process,custrange,type
  307.  
  308.  
  309.           Note that when the execution of PROG2 starts, only these four
  310.      memory variables exist.
  311.  
  312.           Now suppose that PROG2 is chained to PROG3, and wants to pass to
  313.      PROG3 the variables TRANSACT, PROCESS, CUSTRANGE, TYPE, and TRDATE.
  314.  
  315.           Then the first command of PROG1 should be:
  316.  
  317.      GLOBAL transact,process,custrange,type
  318.  
  319.      of PROG2:
  320.  
  321.      GLOBAL transact,process,custrange,type,trdate
  322.  
  323.      and of PROG3:
  324.  
  325.      GLOBAL transact,process,custrange,type,trdate
  326.  
  327.           Now if PROG3 chains to PROG1, the variables TRANSACT, PROCESS,
  328.      CUSTRANGE, TYPE are still passed on, but not TRDATE.
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.      GLOBAL                     VPI1  VPI  VPIN                      GLOBAL      VP-Info Level 1 Reference Manual           Page 232          SECTION 4
  344.  
  345.  
  346.  
  347.                                        GO
  348.                                       GOTO
  349.  
  350.      Set current record pointer to new value.
  351.  
  352.      ╔════════════════════════════════════════════════════════════════════╗
  353.      ║ <num const>                                                        ║
  354.      ║ GO <num exp>                                                       ║
  355.      ║ GOTO <num exp>                                                     ║
  356.      ║ GO RECORD <num exp>                                                ║
  357.      ║ GOTO RECORD <num exp>                                              ║
  358.      ║ GO TOP                                                             ║
  359.      ║ GOTO TOP                                                           ║
  360.      ║ GO BOTTOM                                                          ║
  361.      ║ GOTO BOTTOM                                                        ║
  362.      ║                                                                    ║
  363.      ║ <num exp>/<num const>   the number to be assigned to #             ║
  364.      ╚════════════════════════════════════════════════════════════════════╝
  365.  
  366.           The commands GO and GOTO are identical.  They assign a new value
  367.      to #, the current record pointer (see Section 3.4).  The data file is
  368.      repositioned to the record with the new record number.
  369.  
  370.           The forms:
  371.  
  372.      GO <num exp>
  373.      GOTO <num exp>
  374.      GO RECORD <num exp>
  375.      GOTO RECORD <num exp>
  376.  
  377.      evaluate the numeric expression <num exp>, throw away any fractional
  378.      part, and assign the value to the current record pointer, #. So, any
  379.      one of the following commands:
  380.  
  381.      1>2
  382.      1>GO 2
  383.      1>GOTO 2
  384.      1>GO (2+2)/2
  385.  
  386.      accomplishes the same: the record pointer (#) is set to 2.  Note that
  387.  
  388.      1>(2+2)/2
  389.  
  390.      is not allowed.
  391.  
  392.           If the selected file is indexed, the index is adjusted
  393.      accordingly.
  394.  
  395.           GO TOP, GOTO TOP and GO BOTTOM, GOTO BOTTOM are used to position
  396.      the current record pointer to the top and bottom of the current data
  397.      file.  If there is no index in use, the TOP is Record 1, and BOTTOM is
  398.      the last record.  If an index is in use, then the TOP and BOTTOM are
  399.  
  400.      GO/GOTO                    VPI1  VPI  VPIN                     GO/GOTO      VP-Info Level 1 Reference Manual           Page 233          SECTION 4
  401.  
  402.  
  403.      the first and last records according to the index.
  404.  
  405.           Examples:
  406.  
  407.      1>USE employee
  408.      1>GOTO 2
  409.      1>DISPLAY name
  410.            2  Steiner
  411.      1>5
  412.      1>DISPLAY name
  413.            5  Poyner
  414.      1>GOTO 1
  415.      1>DISPLAY name
  416.            1  Marek
  417.      1>GO BOTTOM
  418.      1>DISPLAY name
  419.            6  Wilson
  420.      1>GO TOP
  421.      1>DISPLAY name
  422.            1  Marek
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.      GO/GOTO                    VPI1  VPI  VPIN                     GO/GOTO      VP-Info Level 1 Reference Manual           Page 234          SECTION 4
  458.  
  459.  
  460.  
  461.                                       HELP
  462.  
  463.      Request for information on VP-Info Level 1 commands and related
  464.      topics.
  465.  
  466.      ╔════════════════════════════════════════════════════════════════════╗
  467.      ║ HELP [<string>]                                                    ║
  468.      ╟────────────────────────────────────────────────────────────────────╢
  469.      ║ Option:                                                            ║
  470.      ║                                                                    ║
  471.      ║ <string>   the topic for which help is wanted                      ║
  472.      ╚════════════════════════════════════════════════════════════════════╝
  473.  
  474.           The HELP command provides information on the syntax (format
  475.      rules) and use of the commands of VP-Info Level 1, and some related
  476.      topics; it is available only in Conversational VP-Info Level 1.
  477.  
  478.           The command
  479.  
  480.      1>HELP
  481.  
  482.      displays all the topics for which HELP is available.  Type HELP and
  483.      the topic description.
  484.  
  485.           The text is contained in the file SRI.HLP, VPI.HLP or VPIN.HLP,
  486.      which must be in the same directory as your version's MSG file, either
  487.      in the current directory or on the DOS path.  If the file is not
  488.      found, VP-Info Level 1 will so advise the user.
  489.  
  490.           Examples:
  491.  
  492.           1.
  493.  
  494.      1>HELP
  495.  
  496.      displays the following screen:
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.      HELP                       VPI1  VPI  VPIN                        HELP      VP-Info Level 1 Reference Manual           Page 235          SECTION 4
  515.  
  516.  
  517.  
  518. ──────────────────────────────────────────────────────────────────────────────
  519. GENERAL HELP
  520.                               VP-Info Help
  521.  
  522. Use the arrow keys to move the lightbar and select a topic from the list
  523. below, then press the <ENTER> key.  You may also move the lightbar to the
  524. bottom of the screen and type the name of a specific command or function.
  525.  
  526.                               1. Commands List
  527.                               2. Functions List
  528.                               3. Color Attribute Table
  529.                               4. Command and Field Redirection
  530.                               5. Date Input Formats
  531.                               6. Date Output Formats
  532.                               7. Editing Keys
  533.                               8. Format Strings
  534.                               9. Get Tables
  535.                              10. REPORT Command
  536.                              11. TEXT
  537.                              12. Variables
  538.  
  539.  
  540. ────────────────────────────────────────────────────────────────────────────────
  541. Selection Bar . Select with ┘, Exit with <Esc>, or Enter command....
  542.             Enter topic ░░░░░░░░░░░░░░░
  543. ──────────────────────────────────────────────────────────────────────────────
  544.  
  545.           A selection bar can be moved with up and down arrows to any of
  546.      the 12 topics listed, or moved beyond the topic listing (up or down)
  547.      to the topic-entry window. Fill in any command or function name and
  548.      press <ENTER> for one or more screens of explanation, like this for
  549.      REPLACE:
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.      HELP                       VPI1  VPI  VPIN                        HELP      VP-Info Level 1 Reference Manual           Page 236          SECTION 4
  572.  
  573.  
  574.  
  575. ──────────────────────────────────────────────────────────────────────────────
  576. ROPEN(
  577.  
  578. Sequential file-opening function: opens a file for reading. Once you've
  579. opened a file with ROPEN(, you can use other file-handling functions to
  580. find and read data from the file; e.g., GET(, IN(, READ(, SEEK(, and
  581. SSEEK(.  To close the file, use the function CLOSE(.
  582.  
  583. Form: ROPEN(<filename>[,<file number]>)
  584.  
  585. Type: LOGICAL (DOS file handling)
  586.  
  587. In: <filename>  - a string or string expression: the file to open; if no
  588.      extension is given, VP-Info assumes TXT.
  589.  
  590.     <file number> - (optional) a number from 1 to 4: assigns a file number
  591.     to the DOS file being opened. Other file-handling functions can refer to
  592.     this file by number (default 1).
  593.  
  594. Out: The file is opened for reading. The function itself returns true (T) if
  595.      the action is successful, false (F) if not.
  596.  
  597.  
  598. ────────────────────────────────────────────────────────────────────────────────
  599. Previous Screen - <PgUp>, Exit with <Esc>, or Enter command............
  600.             Enter topic ░░░░░░░░░░░░░░░
  601. ──────────────────────────────────────────────────────────────────────────────
  602.  
  603.  
  604.           2.
  605.  
  606.      1>HELP ROPEN(
  607.  
  608.      displays the screen on ROPEN(, exactly as shown above.  Press <Pg Dn>
  609.      to get to the additional screens if available, <Pg Up> to get to
  610.      previous screen, or <Esc> to get to the command prompt.
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.      HELP                       VPI1  VPI  VPIN                        HELP      VP-Info Level 1 Reference Manual           Page 237          SECTION 4
  629.  
  630.  
  631.                                        IF
  632.  
  633.      Conditional execution of VP-Info Level 1 program segment.
  634.  
  635.      ╔════════════════════════════════════════════════════════════════════╗
  636.      ║ IF <cond>                                                          ║
  637.      ║                                                                    ║
  638.      ║ <cond>     the condition to be evaluated; if true, segment is      ║
  639.      ║            executed                                                ║
  640.      ╚════════════════════════════════════════════════════════════════════╝
  641.  
  642.           The IF command allows conditional execution of a program segment.
  643.      The general form of this command is:
  644.  
  645.      IF <cond>
  646.         <program segment>
  647.      [ELSE
  648.         <ELSE program segment>]
  649.      ENDIF
  650.  
  651.           This works as follows: When the IF command is found, the
  652.      condition <cond> is evaluated.  If <cond> is true, the <program
  653.      segment> (a number of program lines) is executed.  The end of the
  654.      <program segment> is at the ELSE or at the ENDIF (whichever comes
  655.      first).
  656.  
  657.           If <cond> is false, VP-Info Level 1 looks for ELSE.  If ELSE is
  658.      found, the <ELSE program segment> is executed.
  659.  
  660.           The execution continues with the program line following the
  661.      ENDIF.
  662.  
  663.           Note that ELSE is optional.
  664.  
  665.           There can be an IF command within an IF command; this is called
  666.      nesting.  Many level of nesting is permitted; however, too many levels
  667.      of nesting will give a compile-time error message: Stack overflow.
  668.  
  669.           Care should be taken to nest the IF commands properly in a DO
  670.      WHILE, DO CASE, or REPEAT program structure.  When editing with the
  671.      internal VP-Info Level 1 programming editor (see WRITE command), Alt-F
  672.      reformats the file with all structures properly indented, making it
  673.      easy to see unbalanced structures.
  674.  
  675.           IF may not take a macro.  Since a line with a macro is not
  676.      compiled until runtime, VP-Info Level 1 will be unable to handle
  677.      nesting properly if a macro is used, resulting in the error message
  678.      "ENDIF implies IF" or "ELSE implies IF."  For an alternative, see
  679.      example 4 below.
  680.  
  681.  
  682.  
  683.  
  684.  
  685.      IF                         VPI1  VPI  VPIN                          IF      VP-Info Level 1 Reference Manual           Page 238          SECTION 4
  686.  
  687.  
  688.  
  689.           Examples:
  690.  
  691.           1.
  692.  
  693.      IF count>5
  694.         STORE T TO ok
  695.      ELSE
  696.         IF count<2
  697.            STORE F TO ok
  698.         ENDIF
  699.         ? 'ok'
  700.      ENDIF
  701.  
  702.  
  703.           Indenting the program lines helps to show the level of nesting of
  704.      the structures.  In WRITE, Alt-F indents the lines and capitalizes the
  705.      command verbs.
  706.  
  707.           2. Rewrite:
  708.  
  709.      do while count<5
  710.      if name='DAVID'
  711.      name=name+fname
  712.      enddo
  713.      endif
  714.  
  715.      as follows:
  716.  
  717.      DO WHILE count<5
  718.         IF name='DAVID'
  719.            name=name+fname
  720.         ENDIF
  721.      ENDDO
  722.  
  723.  
  724.           3. Consider the following simple program:
  725.  
  726.      IF num=1
  727.         name='DAVID'
  728.      ELSE
  729.         IF num=2
  730.            name='GEORGE'
  731.         ELSE
  732.            IF num=3
  733.               name='TOM'
  734.            ELSE
  735.               name='UNKNOWN'
  736.            ENDIF
  737.         ENDIF
  738.      ENDIF
  739.  
  740.  
  741.  
  742.      IF                         VPI1  VPI  VPIN                          IF      VP-Info Level 1 Reference Manual           Page 239          SECTION 4
  743.  
  744.  
  745.           This series of nested IF commands (often called "cascading IFs")
  746.      is equivalent to the following DO CASE structure:
  747.  
  748.      DO CASE
  749.      CASE num=1
  750.         name='DAVID'
  751.      CASE num=2
  752.         name='GEORGE'
  753.      CASE num=3
  754.         name='TOM'
  755.      OTHERWISE
  756.         name='UNKNOWN'
  757.      ENDCASE
  758.  
  759.           The DO CASE form is much easier to understand.
  760.  
  761.           4.   If <cond> must be a macro, use the following technique
  762.      instead:
  763.  
  764.      cond2=' '                     ;make sure cond2 exists
  765.      cond2=&condition              ;assign macro to pre-existing variable
  766.      IF cond2                      ;now IF does not have a macro
  767.         ...
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.      IF                         VPI1  VPI  VPIN                          IF      VP-Info Level 1 Reference Manual          Page 240          SECTION 4
  800.  
  801.  
  802.                                      INDEX
  803.  
  804.      Create an index file.
  805.  
  806.      ╔════════════════════════════════════════════════════════════════════╗
  807.      ║ INDEX ON <str exp> TO <file> [FOR <cond>]                          ║
  808.      ║                                                                    ║
  809.      ║ <str exp>  the expression providing the key                        ║
  810.      ║ <file>     the name of the index file                              ║
  811.      ╟────────────────────────────────────────────────────────────────────╢
  812.      ║ Option:                                                            ║
  813.      ║                                                                    ║
  814.      ║ FOR <cond> a selction; only records for which <cond> is true are   ║
  815.      ║               included in the index.                               ║
  816.      ╚════════════════════════════════════════════════════════════════════╝
  817.  
  818.           The INDEX command creates an index file.  Index files are used:
  819.  
  820.           A.   To organize records into an apparent order according to some
  821.                key for listing, reporting, browsing, editing, etc.
  822.  
  823.           B.   To locate records quickly using the FIND, POST and UPDATE
  824.                commands (and in VP-Info Professional by NEAREST, LAST and
  825.                SEEK).  Each key must have a separate index file.
  826.  
  827.           C.   To make the file act as though it had only records matching
  828.                a given selection condition and had an apparent order
  829.                according to some key.
  830.  
  831.           The expression <str exp> must evaluate to a string of length at
  832.      most 60; otherwise, an error message is sent.  In addition, the
  833.      condition itself must be no more than 100 characters long.
  834.  
  835.           (Do not use COMP for the first four letters of an index file;
  836.      VP-Info Level 1 is unable to open such a file.)
  837.  
  838.           Once an index file exists, the data file can be opened for use
  839.      with the index file; see the USE <data file> INDEX <index file>
  840.      command.  The commands: APPEND, BROWSE, CHANGE, EDIT, REPLACE, READ
  841.      automatically update the index files in use.  There can be many index
  842.      files in use, all are updated by these commands, but only one index
  843.      file works with FIND.
  844.  
  845.           If SET TALK ON, INDEX will output progress reports showing the
  846.      completion of each 100 records, and the total number of records
  847.      indexed.  Large files create temporary files which are then merged to
  848.      create the ultimate index.
  849.  
  850.           Index expressions should be of type string, but a numeric field
  851.      (not a numeric expression) can also be used.  If you wish to index on
  852.      a numeric expression, use the key STR(<num exp>) or PIC(<num exp>,
  853.  
  854.  
  855.  
  856.      INDEX ON                   VPI1  VPI  VPIN                    INDEX ON      VP-Info Level 1 Reference Manual          Page 241          SECTION 4
  857.  
  858.  
  859.      <format)) to convert the values to strings.  See the functions STR(
  860.      and PIC(.
  861.  
  862.           It is often helpful to use the upper-case functions, !( or
  863.      UPPER(, for string expression that mix upper-case letters and lower-
  864.      case letters, such as names, addresses, and so on.  This way, the data
  865.      is arranged in alphabetical order instead of the ASCII code order
  866.      which is often confusing.  See the functions CHR( and RANK(.
  867.  
  868.           On a network with SET NETWORK ON in VP-Info Professional Network
  869.      Edition, attempting to create an index while another user is accessing
  870.      a file with the same name will cause a LOCK error.
  871.  
  872.           See also the REINDEX command.
  873.  
  874.           Examples:
  875.  
  876.           1.
  877.  
  878.      1>USE employee
  879.      1>FIND B
  880.      27. File is not indexed.
  881.      1>INDEX ON name TO employee
  882.            6 RECORDS IN TOTAL INDEXED
  883.      1>LIST name
  884.            2  Balzer
  885.            1  Marek
  886.            5  Poyner
  887.            4  Rayme
  888.            3  Steiner
  889.            6  Wilson
  890.      1>FIND R
  891.      1>DISP name
  892.            4  Rayme
  893.  
  894.           Note that once the data file is indexed, you can use FIND.
  895.  
  896.           2.
  897.  
  898.           A data file has a numeric field AMOUNT containing numbers from 1
  899.      to 5,000; to index the file in decreasing order use the key:
  900.  
  901.      STR(10000-amount,6)
  902.  
  903.           3.
  904.  
  905.           A mailing list has 50,000 records, including about 250 from Utah.
  906.      An efficient way to select and print a listing of all those in Utah
  907.      is:
  908.  
  909.      USE maillist
  910.  
  911.  
  912.  
  913.      INDEX ON                   VPI1  VPI  VPIN                    INDEX ON      VP-Info Level 1 Reference Manual          Page 242          SECTION 4
  914.  
  915.  
  916.      INDEX ON zip TO utah FOR state='UT'
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.      INDEX ON                   VPI1  VPI  VPIN                    INDEX ON      VP-Info Level 1 Reference Manual          Page 242.1        SECTION 4
  971.                                    INDEX FROM
  972.  
  973.      Create an index file, using the index key of an existing Info, dBASE
  974.      or Clipper index file.
  975.  
  976.      ╔════════════════════════════════════════════════════════════════════╗
  977.      ║ INDEX FROM <filename> [TO <file>] [FOR <cond>]                     ║
  978.      ║                                                                    ║
  979.      ║ <filename>  the name of an existing Info, dBASE or Clipper index   ║
  980.      ║               file                                                 ║
  981.      ╟────────────────────────────────────────────────────────────────────╢
  982.      ║ Options:                                                           ║
  983.      ║                                                                    ║
  984.      ║ <file>      the name of the Info index file to be created with     ║
  985.      ║               the same key expression as <filename>; default is    ║
  986.      ║               same as original <filename>                          ║
  987.      ║ FOR <cond>  a selection; only records for which <cond> is true are ║
  988.      ║               included in the index                                ║
  989.      ╚════════════════════════════════════════════════════════════════════╝
  990.  
  991.           The INDEX FROM command creates an index file using the index
  992.      expression of an existing index, even if the existing index is corrupt
  993.      or even from any version of dBASE (II, III, or IV) or Clipper.  If no
  994.      new name is given with the TO clause, the original file is
  995.      overwritten.
  996.  
  997.           Index files are discussed more fully in the Index TO command
  998.      below.
  999.  
  1000.           When making an index from one created in dBASE or Clipper, be
  1001.      aware that some expressions from these languages are not permitted in
  1002.      Info; if an invalid expression is encountered, an error message is
  1003.      sent.  In addition, the <cond> used with the optional FOR clause must
  1004.      be no more than 100 characters long.
  1005.  
  1006.           For users with existing applications which must be retained in
  1007.      dBASE or Clipper, you may use the FILES ... ENDFILES structure to
  1008.      point to data and index files in your dBASE or Clipper directory.  To
  1009.      avoid confusion between dBASE and Info index files, which both use the
  1010.      default extension NDX, you will probably want to specify an extension
  1011.      such as KEY in Info.  See example 2 below for a program that uses a
  1012.      FILES ... ENDFILES structure and the DIR( function to search for index
  1013.      files in a dBASE directory to be used as templates for Info index
  1014.      files using the same data files.
  1015.  
  1016.           (Note: You may not use COMP for the first four letters of a data
  1017.      or index file; Info is unable to open such a file with the USE
  1018.      command.)
  1019.  
  1020.           Once an index file exists, the data file can be opened for use
  1021.      with the index file; see the USE <data file> INDEX <index file>
  1022.  
  1023.  
  1024.      INDEX ON                   VPI1  VPI  VPIN                    INDEX ON
  1025.      VP-Info Level 1 Reference Manual             Page 242.2       SECTION 4
  1026.  
  1027.  
  1028.      command.  The commands: APPEND, BROWSE, CHANGE, EDIT, REPLACE, READ
  1029.      automatically update the index files in use.  There can be many index
  1030.      files in use, all are updated by these commands, but only one index
  1031.      file works with FIND.
  1032.  
  1033.           If SET TALK ON and in Conversational Info, INDEX FROM will output
  1034.      progress reports showing the completion of each 100 records, and the
  1035.      total number of records indexed.  Large files create temporary files
  1036.      which are then merged to create the ultimate index.
  1037.  
  1038.           On a network with SET NETWORK ON in VP-Info Professional Network
  1039.      Edition, attempting to create an index while another user is accessing
  1040.      a file with the same name will cause a LOCK error.
  1041.  
  1042.           See also the INDEX ON and REINDEX commands.
  1043.  
  1044.           Examples:
  1045.  
  1046.           1.
  1047.  
  1048.      1>USE employee
  1049.      1>INDEX FROM emplnum TO emplnum
  1050.            6 RECORDS IN TOTAL INDEXED
  1051.      1>INDEX FROM emplnum
  1052.            6 RECORDS IN TOTAL INDEXED
  1053.      1>INDEX FROM emplnum TO empmarry FOR married
  1054.            4 RECORDS IN TOTAL INDEXED
  1055.  
  1056.           2.
  1057.  
  1058.           An application written in dBASE keeps its data and index files in
  1059.      C:\DATA.  The following FILES ... ENDFILES structure is in the CNF
  1060.      files executed when Info was started:
  1061.  
  1062.      FILES
  1063.      *.dbf,c:\data\
  1064.      *.ndx,c:\data\
  1065.      *.key,c:\info\key\
  1066.      *.frm,c:\info\
  1067.      ENDFILES
  1068.  
  1069.           This allows the following program to work properly, assuming that
  1070.      C:\DATA has no more than 60 data files and all index files share the
  1071.      first four letters with the data file on which they are created (an
  1072.      excellent practice):
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081.      INDEX ON                   VPI1  VPI  VPIN                    INDEX ON
  1082.      VP-Info Level 1 Reference Manual             Page 242.3      SECTION 4
  1083.  
  1084.  
  1085.  
  1086.      ─────────────────────────────────────────────────────────────────────────
  1087.      **********************************************************************
  1088.      *  dBASEndx.prg   demonstration program for the INDEX FROM command
  1089.      *                 to allow automatic maintenance of INFO indexes with
  1090.      *                 the same keys as the indexes dBASE itself maintains
  1091.      *     Note the use of DIRF command to display directory of files
  1092.      *        according to FILES table set by FILES ... ENDFILES structure
  1093.      *     Note also that all variables have an off prefix (qz_) as a
  1094.      *        safeguard against confusing INFO if a data file has a field
  1095.      *        name identical to a variable name (FNAME is frequent, QZ_FNAME
  1096.      *        is improbable)
  1097.      *  (C) 1990 Sub Rosa Publishing Inc.  (Author: Sidney L. Bursten)
  1098.      **********************************************************************
  1099.      SET talk on      ;so you can see the indexing in progress
  1100.      WINDOW
  1101.      ERASE
  1102.      *name any data file in next line, so INFO compiler knows one will be opened
  1103.      USE E:TRANS COMPILE
  1104.      CLS
  1105.      DIRF *.dbf      ;get directory using FILES...ENDFILES structure
  1106.      SCREEN 1,2      ;save directory as screen display
  1107.      DO WHILE t
  1108.         SCREEN 2,1   ;restore saved screen
  1109.         ? '     In entering file names, do not use period or extension'
  1110.         ACCEPT 'Enter name of data file (RETURN only exits) ... ' to qz_fname
  1111.         IF qz_fname=' '
  1112.            @ 24,0    ;erase last line of screen
  1113.            CANCEL    ;end program
  1114.         ENDIF
  1115.         USE &qz_fname
  1116.         CLS
  1117.         qz_mask=TRIM(left(qz_fname,4))+'*.ndx'  ;build search mask for DIRF
  1118.         DIRF &qz_mask      ;get directory using FILES...ENDFILES structure
  1119.         SCREEN 1,3         ;store this screen, too
  1120.         DO WHILE t
  1121.            SCREEN 3,1      ;restore directory screen after every execution
  1122.            ? '     In entering file names, do not use period or extension'
  1123.            ACCEPT 'Enter name of index file (RETURN only exits) ... ' to
  1124.      qz_iname
  1125.            IF qz_iname=' '
  1126.               BREAK        ;get back into outer loop for next data file
  1127.            ENDIF
  1128.            qz_iname=trim(qz_iname)
  1129.      * add extension to output name so file goes into current directory
  1130.            qz_kname=qz_iname+'.key'
  1131.            INDEX FROM &qz_iname TO &qz_kname ;original file unchanged
  1132.            WAIT                           ;pause to display results
  1133.         ENDDO
  1134.      ENDDO
  1135.      ─────────────────────────────────────────────────────────────────────────
  1136.  
  1137.  
  1138.      INDEX ON                   VPI1  VPI  VPIN                    INDEX ON
  1139.      VP-Info Level 1 Reference Manual             Page 242.4       SECTION 4
  1140.  
  1141.  
  1142.  
  1143.           When run, the program displays the appropriate files, inputs a file
  1144.      name, and acts accordingly:
  1145.  
  1146.      ─────────────────────────────────────────────────────────────────────────
  1147.  
  1148.      APPTEST.DBF      734  9-06-90 10:07p   AVTEST.DBF       522  5-18-88  2:23p
  1149.      BIGKEY.DBF      8798  6-12-88  8:59a   BUG809.DBF      7347  8-09-90  9:46a
  1150.      CCUST.DBF        522 10-13-88  5:42p   COMMS.DBF       6546  1-06-91  5:11p
  1151.      COMMS2.DBF      6342  1-07-91  1:00p   CUSTJUNK.DBF    7062  9-17-90  3:57p
  1152.      CUSTOMER.DBF     734 11-29-90 10:43p   DB4.DBF          406  9-10-90  1:38p
  1153.      EXPORT.DBF    635959 11-08-90  2:53p   F1.DBF          1249  1-07-91  6:56p
  1154.      F2.DBF          1187  1-07-91  6:56p   F3.DBF           505  1-07-91  6:56p
  1155.      FUNC.DBF        2832  1-07-91  7:38p   FUNC2.DBF        258  1-07-91  7:33p
  1156.      JOE.DBF          792  9-09-90 11:36a   JUNK.DBF       43254  1-14-91  8:21p
  1157.      JUNK2.DBF       5286  1-14-91 11:08a   JUNK8.DBF        121  9-18-90  7:52a
  1158.      JUNK9.DBF       1073  9-18-90  7:51a   LONG.DBF        1137  7-17-90 11:26a
  1159.      MATRIX.DBF      4130  9-04-90  1:50p   MTEST.DBF        522  7-28-88 10:27a
  1160.      NEWTEST.DBF      682  7-27-88 12:01p   NEWTEXT.DBF      522  7-27-88 10:48a
  1161.      PAINT2.DBF      4130  8-06-90 11:09a   PAINT3.DBF      4130  8-06-90 11:10a
  1162.      PAINTMEM.DBF    4130  8-06-90 11:09a   POS1.DBF       12830  5-28-88  9:58a
  1163.      PTEST.DBF        570  7-28-88 10:26a   SEN.DBF            1  9-06-90  9:36a
  1164.      SHARETST.DBF    6271  9-08-90  6:18p   SID.DBF        18432  9-02-90  6:28p
  1165.      SID2.DBF          66  6-03-88 11:38a   TEST.DBF        3312  1-14-91  8:18p
  1166.      TEST2.DBF        372  2-10-91  5:33p   TESTTEST.DBF    2094  3-17-90 12:40p
  1167.      THREE.DBF        189  6-12-88  9:21a   TRANSACT.DBF       2  5-02-88  2:48p
  1168.      VAITEST.DBF      552  7-28-88 12:32p   HELP.DBF         234  4-08-91  4:47p
  1169.  
  1170.      795837 bytes in 42 files.
  1171.      1724416 bytes remaining.
  1172.         ? '     In entering file names, do not period or use extension'
  1173.      Enter name of data file (RETURN only exits) ... customer
  1174.      ─────────────────────────────────────────────────────────────────────────
  1175.  
  1176.      CUSTNAME.NDX    1028 11-30-90  5:36p   CUSTNUM.NDX     1024  4-17-91 11:10a
  1177.      CUST1.NDX       1028  3-19-91  6:51p   CUST2.NDX       1028  3-19-91  6:51p
  1178.  
  1179.      4108 bytes in 4 files.
  1180.      1724416 bytes remaining.
  1181.         ? '     In entering file names, do not period or use extension'
  1182.      Enter name of index file (RETURN only exits) ...  cust2
  1183.             4 RECORDS READ
  1184.             4 RECORDS INDEXED
  1185.      WAITING
  1186.  
  1187.      ─────────────────────────────────────────────────────────────────────────
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.      INDEX ON                   VPI1  VPI  VPIN                    INDEX ON
  1196.      VP-Info Level 1 Reference Manual          Page 243          SECTION 4
  1197.  
  1198.  
  1199.  
  1200.                                      INPUT
  1201.  
  1202.      Input request for data of any type.
  1203.  
  1204.      ╔════════════════════════════════════════════════════════════════════╗
  1205.      ║ INPUT ['<string>'] TO <memvar>                                     ║
  1206.      ╟────────────────────────────────────────────────────────────────────╢
  1207.      ║ Option:                                                            ║
  1208.      ║                                                                    ║
  1209.      ║ '<string>'     prompt message                                      ║
  1210.      ╚════════════════════════════════════════════════════════════════════╝
  1211.  
  1212.           The command INPUT is used to enter string, numeric, or logical
  1213.      data into a memory variable, <memvar>.  It works the same way as the
  1214.      command ACCEPT (see ACCEPT), except that string input needs quotation
  1215.      marks.
  1216.  
  1217.           The type of the <memvar> is determined as follows:
  1218.  
  1219.           If the data typed in is in quotation marks, it is a string;
  1220.      <memvar> is of character type.
  1221.  
  1222.           If the data is a number, <memvar> is of numeric type.
  1223.  
  1224.           If the data is Y, y, N, n, T, t, F, or f, <memvar> is of logical
  1225.      type.
  1226.  
  1227.           The optional character string is used as a prompt.  A character
  1228.      expression cannot be used, but a macro is permitted, provided the
  1229.      macro expression includes quotation marks.
  1230.  
  1231.           ACCEPT is the preferred way to enter strings, since ACCEPT does
  1232.      not require quotation marks as delimiters.
  1233.  
  1234.           <memvar> cannot be a matrix variable.
  1235.  
  1236.           Examples:
  1237.  
  1238.      1>INPUT 'Your name: ' TO name
  1239.      Your name: 'Cathy'
  1240.      1>INPUT 'Your age: ' TO age
  1241.      Your age: 32
  1242.      1>INPUT 'Are you telling the truth? ' TO truth
  1243.      Are you telling the truth? n
  1244.      1>LIST MEMO
  1245.  
  1246.      Name          Type    Width    Contents
  1247.      NAME            C       5      Cathy
  1248.      AGE             N       8      32
  1249.      TRUTH           L       2      .F.
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.      INPUT                      VPI1  VPI  VPIN                       INPU      VP-Info Level 1 Reference Manual          Page 244          SECTION 4
  1256.  
  1257.  
  1258.      ** Total **  3  variables, 15  bytes
  1259.  
  1260.           The following illustrates use of a variable instead of a string
  1261.      as the prompt:
  1262.  
  1263.  
  1264.      1>prompt='"This is a prompt: "'
  1265.      1>INPUT &prompt TO hello
  1266.      This is a prompt:  4
  1267.      1>LIST MEMORY
  1268.  
  1269.      Name          Type    Width    Contents
  1270.      PROMPT          C      20      "This is a prompt: "
  1271.      HELLO           N       8      4
  1272.      ** Total ** 2  variables... 28  bytes
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.      INPUT                      VPI1  VPI  VPIN                       INPUT      VP-Info Level 1 Reference Manual          Page 245          SECTION 4
  1313.  
  1314.  
  1315.  
  1316.                                       LAST
  1317.  
  1318.      Find the last record matching a given FIND string by its index in the
  1319.      selected data file.
  1320.  
  1321.      ╔════════════════════════════════════════════════════════════════════╗
  1322.      ║ LAST <string>                                                      ║
  1323.      ║                          VP-Info Professional only                 ║
  1324.      ║                                                                    ║
  1325.      ║ <string>   the characters to match in the current master index     ║
  1326.      ╚════════════════════════════════════════════════════════════════════╝
  1327.  
  1328.           LAST is one of a family of commands that finds a record in an
  1329.      indexed data file by matching a given string with key values in the
  1330.      index file:
  1331.  
  1332.           LAST positions the file on the last record in the index matching
  1333.                the FIND string (VP-Info Professional only) (no-find
  1334.                positions the file at the top of file)
  1335.           FIND positions the file on the first record in the index matching
  1336.                the LAST string (no-find positions the file at the top of
  1337.                file)
  1338.           NEAREST positions the file on the first record in the index equal
  1339.                to or greater than the FIND string (VP-Info Professional
  1340.                only)
  1341.           SEEK is identical to FIND, except that it searches for the match
  1342.                to the value of a character expression instead of a string
  1343.                constant (VP-Info Professional only) (no-find positions the
  1344.                file at the top of file)
  1345.  
  1346.           All forms allow a search to be made on a character expression
  1347.      when the expression if preceded by the macro symbol "&".  When the
  1348.      variable var='TAYLOR', both of the following command lines are
  1349.      equivalent:
  1350.  
  1351.      LAST TAYLOR
  1352.      LAST &var
  1353.  
  1354.           In Conversational VP-Info Level 1, just type LAST and the key.
  1355.  
  1356.           Examples:
  1357.  
  1358.      1>LAST TAYLOR
  1359.      1>LAST TOM
  1360.  
  1361.           If SET DELETE ON, deleted records will not be found.  (See the
  1362.      command SET.)
  1363.  
  1364.           Numbers must always be treated as strings, even if the key
  1365.      expression is a numeric field.  If NUM is a numeric field of width 2,
  1366.  
  1367.  
  1368.  
  1369.      LAST                           VPI  VPIN                          LAST      VP-Info Level 1 Reference Manual          Page 246          SECTION 4
  1370.  
  1371.  
  1372.      LAST 1 will not find 1, but LAST &STR(1,2) or LAST &' 1' will be
  1373.      successful.
  1374.  
  1375.           For the users' convenience, Conversational VP-Info Level 1
  1376.      converts all command lines to upper case before execution.  So, to
  1377.      find the inventory numbers that start with AB, type either of the
  1378.      following two commands:
  1379.  
  1380.      1>LAST AB
  1381.      1>LAST ab
  1382.  
  1383.           It follows that
  1384.  
  1385.      1>LAST Taylor
  1386.  
  1387.      is understood by VP-Info Level 1 as LAST TAYLOR.  If you have to find
  1388.      Taylor, either use the string directly with the macro symbol:
  1389.  
  1390.      1>LAST &'Taylor'
  1391.  
  1392.      or if name='Taylor' use the following:
  1393.  
  1394.      1>LAST &name
  1395.  
  1396.           In a Level 1 program, FIND the key in the file, use the LIMIT
  1397.      command to limit the scope of all positioning commands to those
  1398.      records matching the FIND string, and GOTO BOTTOM.
  1399.  
  1400.           When LAST is successful, the value of the current record pointer
  1401.      (as shown by the # and RECNO( functions) is set to the current record
  1402.      number, and the system variable :NEAR is set to the same number.
  1403.  
  1404.           If the record is not found, the current record pointer will be
  1405.      set to 0 and the value of :NEAR will be set to the number of the first
  1406.      record in the index with a key greater than the FIND string; if the
  1407.      index contains no key greater than the FIND string, :NEAR is set to
  1408.      the bottom of file, and EOF is set to T (true).
  1409.  
  1410.           For a fuller discussion, see the FIND command.
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.      LAST                           VPI  VPIN                          LAST      VP-Info Level 1 Reference Manual          Page 247          SECTION 4
  1427.  
  1428.  
  1429.  
  1430.                                      LIMIT
  1431.  
  1432.      Limit the records available within the current master index to those
  1433.      matching all or part of the current record's index key.
  1434.  
  1435.      ╔════════════════════════════════════════════════════════════════════╗
  1436.      ║ LIMIT <num exp>                                                    ║
  1437.      ║ LIMIT <key exp>                                                    ║
  1438.      ║ LIMIT                                                              ║
  1439.      ╟────────────────────────────────────────────────────────────────────╢
  1440.      ║ Options:                                                           ║
  1441.      ║                                                                    ║
  1442.      ║ <num exp>    the number of characters in the key expression of     ║
  1443.      ║                 the current master index                           ║
  1444.      ║ <key exp>    the string expression to match in the current master  ║
  1445.      ║                 index                                              ║
  1446.      ╚════════════════════════════════════════════════════════════════════╝
  1447.  
  1448.           When the current file has an index, VP-Info Level 1 can be made
  1449.      to treat the file as though it includes only those records matching
  1450.      the current record's key expression, or some leftmost part of it.
  1451.      When a LIMIT is in effect, no VP-Info Level 1 command can access a
  1452.      record outside that limit.
  1453.  
  1454.           You can most quickly implement this command by using the
  1455.      <num exp> option.  The effect is to have VP-Info Level 1 set the LIMIT
  1456.      to the leftmost <num exp> characters of the key expression of the
  1457.      master index.
  1458.  
  1459.           If <num exp> exceeds the length of the key, the effect is
  1460.      identical to setting the LIMIT to the entire index expression.
  1461.      (Maximum index-key length is 60 characters.)
  1462.  
  1463.           When LIMIT is used with no option, or when <num exp> is zero, the
  1464.      limit is deactivated.
  1465.  
  1466.           Using LIMIT with <key exp> requires precision in its use to avoid
  1467.      problems that may become extremely serious. Note that the <key exp>
  1468.      expression must be the same as the master index key in use at the
  1469.      moment, or some LEFT( portion of it. Do not attempt to use an
  1470.      expression that does not meet this requirement.
  1471.  
  1472.           Cautions:
  1473.  
  1474.           A.   FIND should not be used on a file with an active limit.  If
  1475.                you choose to do so, be certain that the FIND will be
  1476.                successful.  An unsuccessful FIND places the record pointer
  1477.                on record 0 which is by definition not in the index.  This
  1478.                causes an error, suspends operation of a program, and turns
  1479.                off the LIMIT.
  1480.  
  1481.  
  1482.  
  1483.      LIMIT                      VPI1  VPI  VPIN                       LIMIT      VP-Info Level 1 Reference Manual          Page 248          SECTION 4
  1484.  
  1485.  
  1486.  
  1487.           B.   Do not use REPLACE ALL on a field included in an active
  1488.                limit expression, since upon completion, no records will be
  1489.                included in the limit; the result is the same as above.
  1490.  
  1491.           C.   Do not use APPEND, APPEND BLANK or BROWSE APPEND, or enter
  1492.                "append mode" in EDIT, while a limit is active unless you
  1493.                are sure to make all new records equal to the current LIMIT
  1494.                key before leaving the new records.  Doing so causes the
  1495.                record pointer to move outside the LIMIT; the result is the
  1496.                same as above.
  1497.  
  1498.           D.   LIMIT should be used with extreme care, and left in effect
  1499.                for the minimum number of commands possible.  For instance,
  1500.                if used with BROWSE, LIMIT should be invoked immediately
  1501.                before the BROWSE command and canceled immediately
  1502.                afterward.
  1503.  
  1504.           E.   LIMIT is automatically canceled when the index or the file
  1505.                with which it is active is closed, or the master index is
  1506.                changed with SET INDEX TO n.
  1507.  
  1508.           F.   LIMIT cannot be used with a string constant instead of a
  1509.                <key exp>.  The <key exp> can be implemented with a macro.
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.      LIMIT                      VPI1  VPI  VPIN                       LIMIT      VP-Info Level 1 Reference Manual          Page 249          SECTION 4
  1541.  
  1542.  
  1543.  
  1544.                                       LIST
  1545.  
  1546.      List expressions from selected records.
  1547.  
  1548.      ╔════════════════════════════════════════════════════════════════════╗
  1549.      ║ LIST [<scope>] [FOR <cond>] [<exp list>] [OFF]                     ║
  1550.      ╟────────────────────────────────────────────────────────────────────╢
  1551.      ║ Options:                                                           ║
  1552.      ║                                                                    ║
  1553.      ║ <scope>        select by scope (default scope: ALL)                ║
  1554.      ║ FOR <cond>     select by condition                                 ║
  1555.      ║ <exp list>     items to list                                       ║
  1556.      ║ OFF            do not print the record numbers                     ║
  1557.      ╚════════════════════════════════════════════════════════════════════╝
  1558.  
  1559.           This command lists the whole selected data file (including the
  1560.      records flagged as DELETED, unless the command SET DELETE ON is
  1561.      given).  If the data file is indexed, the listing is by the indexed
  1562.      order.
  1563.  
  1564.           The records to be listed can be selected by scope and/or by a
  1565.      condition.  To list only selected fields of the records, use an
  1566.      expression list.
  1567.  
  1568.           Examples:
  1569.  
  1570.  
  1571.      1>USE employee
  1572.      1>LIST
  1573.            1  Marek           Joe        231 River Drive      Broomsdale
  1574.            2  Balzer          Joan       2407 E 38th Street   Broomsdale
  1575.            3  Steiner         Tom        114 North Pitt St.   Lakewood
  1576.            4  Rayme           Pamela     42368 Wedgewood Dr.  Broomsdale
  1577.            5  Poyner          Roger      2757 Regency Road    Florington
  1578.            6  Wilson          Robert     16255 Ventura Street Broomsdale
  1579.      1>GO TOP
  1580.      1>LIST NEXT 3 fname,name
  1581.            1  Joe        Marek
  1582.            2  Joan       Balzer
  1583.            3  Tom        Steiner
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596.  
  1597.      LIST                       VPI1  VPI  VPIN                        LIST      VP-Info Level 1 Reference Manual          Page 250          SECTION 4
  1598.  
  1599.  
  1600.  
  1601.                                    LIST FILES
  1602.  
  1603.      List files from the directory.
  1604.  
  1605.      ╔════════════════════════════════════════════════════════════════════╗
  1606.      ║ LIST FILES [LIKE <file format>] [ON <drive letter>]                ║
  1607.      ╟────────────────────────────────────────────────────────────────────╢
  1608.      ║ Options:                                                           ║
  1609.      ║                                                                    ║
  1610.      ║ LIKE <file format>   limit to those files matching the file format ║
  1611.      ║                         specification (default .DBF)               ║
  1612.      ║ ON <drive letter>    show only files on named disk (colon optional)║
  1613.      ╚════════════════════════════════════════════════════════════════════╝
  1614.  
  1615.           This command lists the data files, with the default extension
  1616.      DBF, from the current or other specified disk drive.  LIST FILES is
  1617.      provided only for compatibility with earlier versions of VP-Info; DIR
  1618.      should be used instead.
  1619.  
  1620.           If the LIKE clause is used, the type of file required can be
  1621.      specified; the wild cards * and ? (see the DIR command) can be used
  1622.      just as in the operating system command DIR.
  1623.  
  1624.           If the ON <drive letter> clause is used, only the files from the
  1625.      drive specified are listed.
  1626.  
  1627.           See the VP-Info Level 1 command DIR.
  1628.  
  1629.           Examples:
  1630.  
  1631.  
  1632.      1>LIST FILES
  1633.      CCUST.DBF       1024 10-24-89  1:07a   COMMS.DBF       1024 10-24-89  1:07a
  1634.      COMMS.DBF        757  8-31-89 11:30p   CUSTJUNK.DBF     653  9-06-89  9:02a
  1635.      CUSTOMER.DBF    1024 10-24-89  1:07a   RUST2.DBF     342058 11-29-89  8:25p
  1636.      SUBDUE.DBF      2027 11-29-89  7:21p   SUBDUE2.DBF     1168 11-29-89  2:29a
  1637.      WAY_BUSI.DBF  506022 10-24-89  2:24a   WAY_PHON.DBF   45525 10-24-89  1:29a
  1638.      WAY_DBFS.DBF    1291 10-24-89  3:15a   WAY_RES.DBF   406175 10-24-89  1:05a
  1639.  
  1640.      1024349 bytes in 12 files.
  1641.      5251072 bytes remaining.
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.      LIST FILES                 VPI1  VPI  VPIN                  LIST FILES      VP-Info Level 1 Reference Manual          Page 251          SECTION 4
  1655.  
  1656.  
  1657.      1>LIST FILES ON A
  1658.      THREE.DBF        189  6-12-88  9:21a   TRANSACT.DBF       2  5-02-88  2:48p
  1659.      VAITEST.DBF      552  7-28-88 12:32p
  1660.  
  1661.      795603 bytes in 41 files.
  1662.      51072 bytes remaining.
  1663.      1>LIST FILE LIKE c*.*
  1664.      CCUST.DBF        522 10-13-88  5:42p   COMMS.DBF       6546  1-06-90  5:11p
  1665.      COMMS2.DBF      6342  1-07-90  1:00p   CUSTJUNK.DBF    7062  9-17-89  3:57p
  1666.      CUSTOMER.DBF     734 11-29-89 10:43p
  1667.  
  1668.      21206 bytes in 5 files.
  1669.      5251072 bytes remaining.
  1670.  
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.      LIST FILES                 VPI1  VPI  VPIN                  LIST FILES      VP-Info Level 1 Reference Manual          Page 252          SECTION 4
  1712.  
  1713.  
  1714.  
  1715.                                   LIST MEMORY
  1716.  
  1717.      List the memory variables.
  1718.  
  1719.      ╔════════════════════════════════════════════════════════════════════╗
  1720.      ║ LIST MEMORY                                                        ║
  1721.      ╚════════════════════════════════════════════════════════════════════╝
  1722.  
  1723.           The command LIST MEMORY displays a listing of all non-matrix
  1724.      memory variables and their contents, and a separate listing of the
  1725.      matrix variables and their dimensions.
  1726.  
  1727.           Examples:
  1728.  
  1729.      1>LIST MEMO
  1730.  
  1731.      Name          Type    Width    Contents
  1732.      ** Total **  0  Variables used  0  Bytes used
  1733.      1>name='David'
  1734.      1>number=12.78
  1735.      1>LIST MEMO
  1736.  
  1737.      Name          Type    Width    Contents
  1738.      NAME            C       5      David
  1739.      NUMBER          N       8      12.78
  1740.      ** Total **  2  Variables used  13  Bytes used
  1741.      1>DIM NUM a[12]
  1742.      1>DIM CHAR table[2,12]
  1743.      1>LIST MEMO
  1744.  
  1745.      Name          Type    Width    Contents
  1746.      NAME            C       5      David
  1747.      NUMBER          N       8      12.78
  1748.  
  1749.      Matrix Name   Type    Width    Dimensions
  1750.      A               N       8      [12]
  1751.      TABLE           C      10      [2,12]
  1752.      ** Total **  4  Variables used  33  Bytes used
  1753.  
  1754.           Note that matrix variables are stored in high memory (see
  1755.      Appendix A).  The number of "bytes used" message does not take this
  1756.      into account.  To see the usage of high memory, use the STATUS
  1757.      command.  See also DIM.
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.      LIST MEMORY                VPI1  VPI  VPIN                 LIST MEMORY      VP-Info Level 1 Reference Manual          Page 253          SECTION 4
  1769.  
  1770.  
  1771.  
  1772.                                  LIST STRUCTURE
  1773.  
  1774.      List the structure of the selected file.
  1775.  
  1776.      ╔════════════════════════════════════════════════════════════════════╗
  1777.      ║ LIST STRUCTURE                                                     ║
  1778.      ╚════════════════════════════════════════════════════════════════════╝
  1779.  
  1780.           The command LIST STRUCTURE displays the structure of the selected
  1781.      data file.
  1782.  
  1783.           Examples:
  1784.  
  1785.      1>USE employee
  1786.      1>LIST STRU
  1787.      Data file:           EMPLOYEE.DBF
  1788.      Number of records:       6
  1789.      File number:             1
  1790.      Field   Name       Type Width   Dec
  1791.        1     NAME         C     15
  1792.        2     FNAME        C     10
  1793.        3     ADDR         C     20
  1794.        4     CITY         C     20
  1795.        5     STATE        C      2
  1796.        6     ZIP          C      5
  1797.        7     TEL_NO       C      8
  1798.        8     MARRIED      L      1
  1799.        9     SALARY       N      9      2
  1800.       10     YEAR_EMP     N      4
  1801.       11     DEPT         C     15
  1802.      ** Record Length **       110
  1803.      1>USE#5 order
  1804.      1>LIST#5 STRU
  1805.      Data file:           ORDER.DBF
  1806.      Number of records:       3
  1807.      File number:            #5
  1808.      Field   Name       Type Width   Dec
  1809.        1     ORDER:NO     C      6
  1810.        2     CUST:NO      C      6
  1811.        3     INVEN:NO     C      6
  1812.        4     STYLE:NO     C      4
  1813.        5     COLOR        C      2
  1814.        6     CATEGORY     C      2
  1815.        7     DESCR        C     30
  1816.        8     SLSMAN:NO    C      3
  1817.        9     PRICE        N      9      2
  1818.       10     QTY          N      9      2
  1819.       11     COST         N      9      2
  1820.       12     AMOUNT       N      9      2
  1821.      ** Record Length **        96
  1822.  
  1823.  
  1824.  
  1825.      LIST STRUCTURE             VPI1  VPI  VPIN              LIST STRUCTURE      VP-Info Level 1 Reference Manual          Page 254          SECTION 4
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.  
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.  
  1867.  
  1868.  
  1869.  
  1870.  
  1871.  
  1872.  
  1873.  
  1874.  
  1875.  
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.      LIST STRUCTURE             VPI1  VPI  VPIN              LIST STRUCTURE      VP-Info Level 1 Reference Manual          Page 255          SECTION 4
  1883.  
  1884.  
  1885.  
  1886.                                   LIST SYSTEM
  1887.  
  1888.      List the function key definitions and system variables.
  1889.  
  1890.      ╔════════════════════════════════════════════════════════════════════╗
  1891.      ║ LIST SYSTEM                                                        ║
  1892.      ╚════════════════════════════════════════════════════════════════════╝
  1893.  
  1894.           The command LIST SYSTEM displays the current contents of the 10
  1895.      function keys and system variables (see Sections 1.2 and 2.6).
  1896.  
  1897.           Example:
  1898.  
  1899.      1>LIST SYST
  1900.      Name          Type    Width    Contents
  1901.      :F1             C       5      HELP
  1902.      :F2             C      10      LIST STRU;
  1903.      :F3             C       6      WRITE
  1904.      :F4             C      10      LIST MEMO;
  1905.      :F5             C       7      BROWSE;
  1906.      :F6             C       5      STAT;
  1907.      :F7             C      12      ^wCONT;EDIT;
  1908.      :F8             C      11      LOCATE FOR
  1909.      :F9             C       5      FIND
  1910.      :F10            C       5      EDIT;
  1911.      :TIME           C       8      22:53:43
  1912.      :DATE           C      24      Thursday, March 19, 1991
  1913.      :VERSION        C       4      510
  1914.      :SERIAL         C      10      5108796982
  1915.      :COMPANY        C      34      Sub Rosa Publishing Inc.
  1916.      :PICTURE        C      10      9999999.99
  1917.      :TITLE          C       1
  1918.      :UNDOC          C       1
  1919.      :KEY            N       8      13
  1920.      :AVAIL          N       8      0
  1921.      :FIELD          N       8      0
  1922.      :ERROR          N       8      0
  1923.      :MESSAGE        C       1
  1924.      :RETRY          N       8      25
  1925.      :USER           N       8      1
  1926.      :DIR            C      11      C:\VPI
  1927.      :NEAR           N       8      0
  1928.      :COLOR          N       8      48
  1929.      ** Total ** 28  variables... 244  bytes
  1930.  
  1931.           To set the system variables to suit your needs, use the SRI.CNF
  1932.      file or the VPI.CNF file as appropriate, see Section 1.
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.      LIST SYSTEM                VPI1  VPI  VPIN                 LIST SYSTEM      VP-Info Level 1 Reference Manual          Page 256          SECTION 4
  1940.  
  1941.  
  1942.  
  1943.                                      LOCATE
  1944.  
  1945.      Search for a record that satisfies the condition.
  1946.  
  1947.      ╔════════════════════════════════════════════════════════════════════╗
  1948.      ║ LOCATE [<scope>] FOR <cond>                                        ║
  1949.      ╟────────────────────────────────────────────────────────────────────╢
  1950.      ║ Option:                                                            ║
  1951.      ║                                                                    ║
  1952.      ║ <scope>   search only within the scope (default scope: ALL)        ║
  1953.      ╚════════════════════════════════════════════════════════════════════╝
  1954.  
  1955.           The command LOCATE searches for records by a condition.  This
  1956.      command works quicker if there is no index file.
  1957.  
  1958.           If a match is found with SET TALK ON,
  1959.  
  1960.      Record n
  1961.  
  1962.      informs the user of the record number (n).
  1963.  
  1964.           The LOCATE command line cannot be more than 128 characters.  The
  1965.      keyword FOR cannot be in a macro.
  1966.  
  1967.           The CONTINUE command continues the search after the current
  1968.      record using the condition of the last LOCATE.
  1969.  
  1970.           Normally, the selected file should not be indexed.  The command
  1971.      LOCATE executes about three time slower in an indexed file.  If an
  1972.      index file is in use, the search will take place in the indexed order.
  1973.  
  1974.           The preferred way to locate a record in an indexed file is with
  1975.      the FIND command.
  1976.  
  1977.           With the default scope ALL, LOCATE starts at the top of file and
  1978.      scans either until the first record matching the condition is found,
  1979.      or the end of file is reached; an unsuccessful LOCATE sets the EOF
  1980.      flag to T (true).
  1981.  
  1982.           You can use an alternate scope, NEXT or WHILE, to have LOCATE
  1983.      begin with the record after the current record.  Unlike all other uses
  1984.      of scope in VP-Info Level 1, however, LOCATE does not require anything
  1985.      other than the keyword to make the scope act in this way.  Example:
  1986.  
  1987.      LOCATE NEXT FOR cust>'M'      ;looks for a matching record anywhere in
  1988.                                    the file, starting with the next record.
  1989.      LOCATE WHILE FOR cust>'M'     ;works exactly the same
  1990.  
  1991.  
  1992.           Examples:
  1993.  
  1994.  
  1995.  
  1996.      LOCATE FOR                 VPI1  VPI  VPIN                  LOCATE FOR      VP-Info Level 1 Reference Manual          Page 257          SECTION 4
  1997.  
  1998.  
  1999.  
  2000.      1>USE employee
  2001.      1>LIST name, salary
  2002.            1  Marek
  2003.            2  Balzer
  2004.            3  Steiner
  2005.            4  Rayme
  2006.            5  Poyner
  2007.            6  Wilson
  2008.      1>GO TOP
  2009.      1>LOCATE FOR salary > 20000
  2010.      Record 1
  2011.      1>? name, salary
  2012.      Marek            25800.00
  2013.      1>CONT
  2014.      Record 3
  2015.      1>? name, salary
  2016.      Steiner          35780.00
  2017.      1>CONT
  2018.      Record 4
  2019.      1>? name, salary
  2020.      Rayme            79110.00
  2021.      1>CONT
  2022.      Record 6
  2023.      1>? name, salary
  2024.      Wilson           33870.00
  2025.      1>CONT
  2026.      1>? EOF
  2027.      T
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.      LOCATE FOR                 VPI1  VPI  VPIN                  LOCATE FOR      VP-Info Level 1 Reference Manual          Page 258          SECTION 4
  2054.  
  2055.  
  2056.  
  2057.                                       LOCK
  2058.  
  2059.      Lock the current record.
  2060.  
  2061.      ╔════════════════════════════════════════════════════════════════════╗
  2062.      ║ LOCK                                                               ║
  2063.      ║                   VP-Info Professional Network Edition only        ║
  2064.      ╚════════════════════════════════════════════════════════════════════╝
  2065.  
  2066.           In VP-Info Professional Network Edition, this command locks the
  2067.      current record to all other users so that you can safely make changes
  2068.      to a record key while the file is open in SHARE mode.
  2069.  
  2070.           If SET NETWORK OFF, LOCK is ignored.
  2071.  
  2072.           In Level 1 and VP-Info Professional, LOCK has no effect, but is
  2073.      accepted for program compatibility across versions.
  2074.  
  2075.           See the SET NETWORK command on how to get into the multi-user
  2076.      mode.  See also UNLOCK.
  2077.  
  2078.           Example:
  2079.  
  2080.      mcust=cust
  2081.      FIND &mcust
  2082.      LOCK
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.      LOCK                             VPIN                             LOCK      VP-Info Level 1 Reference Manual          Page 259          SECTION 4
  2111.  
  2112.  
  2113.  
  2114.                                   LOCK INDEXES
  2115.  
  2116.      Lock the current record.
  2117.  
  2118.      ╔════════════════════════════════════════════════════════════════════╗
  2119.      ║ LOCK INDEXES                                                       ║
  2120.      ║                   VP-Info Professional Network Edition only        ║
  2121.      ╚════════════════════════════════════════════════════════════════════╝
  2122.  
  2123.           In VP-Info Professional Network Edition this command locks all
  2124.      indexes attached to the current data file so that you can safely make
  2125.      changes to a record's key while the file is open in SHARE mode.
  2126.  
  2127.           Like the LOCK command (which locks records in a data file), and
  2128.      SET LOCK ON (which automatically locks each record as it is used),
  2129.      LOCK INDEX should be used only when files are opened in SHARE mode on
  2130.      a network.
  2131.  
  2132.           LOCK INDEXES allows only one person to change the index files,
  2133.      though any number of others can access the indexes if they open the
  2134.      data file in either SHARE or READ mode.  UNLOCK INDEXES will unlock
  2135.      the all the index file.
  2136.  
  2137.           See the SET NETWORK command on how to get into the multi-user
  2138.      mode.  See also UNLOCK INDEXES.
  2139.  
  2140.           In Level 1 and VP-Info Professional, LOCK INDEXES has no effect,
  2141.      but is accepted for program compatibility across versions.
  2142.  
  2143.           Example:
  2144.  
  2145.      mcust=cust
  2146.      FIND &mcust
  2147.      LOCK INDEXES
  2148.  
  2149.  
  2150.  
  2151.  
  2152.  
  2153.  
  2154.  
  2155.  
  2156.  
  2157.  
  2158.  
  2159.  
  2160.  
  2161.  
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.      LOCK INDEXES                     VPIN                     LOCK INDEXES      VP-Info Level 1 Reference Manual          Page 260          SECTION 4
  2168.  
  2169.  
  2170.  
  2171.                                       LOOP
  2172.  
  2173.      Jump to the top of the DO WHILE loop.
  2174.  
  2175.      ╔════════════════════════════════════════════════════════════════════╗
  2176.      ║ LOOP                                                               ║
  2177.      ╚════════════════════════════════════════════════════════════════════╝
  2178.  
  2179.           When the LOOP command is found in a DO WHILE <cond> loop, program
  2180.      execution jumps to the top of loop (evaluates the condition).  See
  2181.      also DO WHILE and BREAK.
  2182.  
  2183.           Example:
  2184.  
  2185.      USE cust
  2186.      USE#2 trans INDEX trans1
  2187.      DO WHILE T
  2188.         ACCEPT 'Enter the customer number ' TO mcust
  2189.         IF TRIM(mcust)=' '
  2190.            BREAK
  2191.         ENDIF
  2192.         FIND#2 &mcust
  2193.         IF RECNO(2)=0
  2194.            LOOP
  2195.         ENDIF
  2196.         SELECT 2
  2197.         DO WHILE custn=mcust .AND. .NOT. EOF
  2198.            ? date,descript,amount
  2199.            SKIP
  2200.         ENDDO
  2201.         SELECT 1
  2202.      ENDDO
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.      LOOP                       VPI1  VPI  VPIN                        LOOP      VP-Info Level 1 Reference Manual          Page 261          SECTION 4
  2225.  
  2226.  
  2227.  
  2228.                                       MAX
  2229.  
  2230.      Scan selected records for the highest values of one or more numeric
  2231.      expressions.
  2232.  
  2233.      ╔════════════════════════════════════════════════════════════════════╗
  2234.      ║ MAX [<scope>] <num exp list> [TO <memvar list>] [FOR <cond>]       ║
  2235.      ║                                                                    ║
  2236.      ║ <num exp list>    the numeric expressions to sum                   ║
  2237.      ╟────────────────────────────────────────────────────────────────────╢
  2238.      ║ Options:                                                           ║
  2239.      ║                                                                    ║
  2240.      ║ <scope>           select by scope (default scope: ALL)             ║
  2241.      ║ <memvar list>     store the results in these memory variables      ║
  2242.      ║ FOR <cond>        select by condition                              ║
  2243.      ╚════════════════════════════════════════════════════════════════════╝
  2244.  
  2245.           The command MAX evaluates numeric expressions for selected
  2246.      records of the selected data file, determining the highest value
  2247.      encountered for each expression.  Up to 10 expressions can be scanned
  2248.      with one command.
  2249.  
  2250.           Optionally, the results can be stored in numeric memory
  2251.      variables; the expression list and the numeric memory variable list
  2252.      must have the same number of entries.  <memvar list> cannot contain
  2253.      numeric matrix variables.
  2254.  
  2255.           Records flagged as DELETED are not scanned.  See also MIN, SUM,
  2256.      COUNT and AVERAGE.
  2257.  
  2258.           Example:
  2259.  
  2260.           The highest hourly wages, the highest annual earnings, and the
  2261.      highest number of hours worked in the year:
  2262.  
  2263.      1>USE employee
  2264.      1>MAX hourly,ydt_earned,ytd_hours
  2265.            6 RECORDS CHECKED
  2266.           32.57,  51579.65,   2632.65
  2267.      1>SET TALK OFF
  2268.      1>MAX hourly,ydt_earned,ytd_hours TO maxrate,maxearned,maxhours
  2269.      1>?  maxrate,maxearned,maxhours
  2270.           32.57   51579.65    2632.65
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.      MAX                        VPI1  VPI  VPIN                         MAX      VP-Info Level 1 Reference Manual          Page 262          SECTION 4
  2282.  
  2283.  
  2284.  
  2285.                                     MEMORY=
  2286.  
  2287.      Request a specific memory configuration for VP-Info Professional.
  2288.  
  2289.      ╔════════════════════════════════════════════════════════════════════╗
  2290.      ║ MEMORY=<blocks>                                                    ║
  2291.      ║          VP-Info Professional only             VPI.SET file only   ║
  2292.      ║                                                                    ║
  2293.      ║ <blocks> number of 1K blocks of memory to reserve for high memory  ║
  2294.      ╚════════════════════════════════════════════════════════════════════╝
  2295.  
  2296.           The command MEMORY= in the VPI.SET file allocates a specific
  2297.      amount of high memory for use of VP-Info Professional rather than the
  2298.      default of 128K.
  2299.  
  2300.           The number of blocks can be as little as 32, although VP-Info
  2301.      Professional can be expected to be sluggish in performance at that
  2302.      level, and there will be little space available for matrixes and
  2303.      background screens.
  2304.  
  2305.           High memory is used for a wide variety of tasks in
  2306.      VP-Info Level 1, including storage of index blocks, print spooling,
  2307.      background screen storage, matrixes, table storage, program swap area,
  2308.      etc.  Requesting 32 to 127 blocks decreases the space available for
  2309.      these tasks, but increases the space available for storing binary
  2310.      files to be executed with the CALL command (see BINSPACE= command) and
  2311.      for running programs in DOS (see RUN command).
  2312.  
  2313.           If large amounts of memory are required for matrixes, you may
  2314.      need to request more than 128 blocks.  Requesting more memory than
  2315.      available will not cause an error; VP-Info Professional always takes
  2316.      all the memory there is or the amount requested, whichever is less.
  2317.  
  2318.           See Appendix A for more about organization of memory.
  2319.  
  2320.           Example:
  2321.  
  2322.      MEMORY=96
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338.      MEMORY=                        VPI  VPIN                       MEMORY=      VP-Info Level 1 Reference Manual          Page 263          SECTION 4
  2339.  
  2340.  
  2341.                                       MIN
  2342.  
  2343.      Scan selected records for the lowest values of one or more numeric
  2344.      expressions.
  2345.  
  2346.      ╔════════════════════════════════════════════════════════════════════╗
  2347.      ║ MIN [<scope>] <num exp list> [TO <memvar list>] [FOR <cond>]       ║
  2348.      ║                                                                    ║
  2349.      ║ <num exp list>    the numeric expressions to sum                   ║
  2350.      ╟────────────────────────────────────────────────────────────────────╢
  2351.      ║ Options:                                                           ║
  2352.      ║                                                                    ║
  2353.      ║ <scope>           select by scope (default scope: ALL)             ║
  2354.      ║ <memvar list>     store the results in these memory variables      ║
  2355.      ║ FOR <cond>        select by condition                              ║
  2356.      ╚════════════════════════════════════════════════════════════════════╝
  2357.  
  2358.           The command MIN evaluates numeric expressions for selected
  2359.      records of the selected data file, determining the lowest value
  2360.      encountered for each expression.  Up to 10 expressions can be scanned
  2361.      with one command.
  2362.  
  2363.           Optionally, the results can be stored in numeric memory
  2364.      variables; the expression list and the numeric memory variable list
  2365.      must have the same number of entries.  <memvar list> cannot contain
  2366.      numeric matrix variables.
  2367.  
  2368.           Records flagged as DELETED are not scanned.  See also MAX, SUM,
  2369.      COUNT and AVERAGE.
  2370.  
  2371.           Example:
  2372.  
  2373.           The lowest hourly wages, the lowest annual earnings, and the
  2374.      lowest number of hours worked in the year:
  2375.  
  2376.      1>USE employee
  2377.      1>MIN hourly,ydt_earned,ytd_hours
  2378.            6 RECORDS CHECKED
  2379.            5.57,   1579.65,    232.65
  2380.      1>SET TALK OFF
  2381.      1>MIN hourly,ydt_earned,ytd_hours TO maxrate,maxearned,maxhours
  2382.      1>?  maxrate,maxearned,maxhours
  2383.            5.57,   1579.65,    232.65
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  
  2392.  
  2393.  
  2394.  
  2395.      MIN                        VPI1  VPI  VPIN                         MIN      VP-Info Level 1 Reference Manual          Page 264          SECTION 4
  2396.  
  2397.  
  2398.  
  2399.                                      MODIFY
  2400.  
  2401.      Modify the structure of a data file.
  2402.  
  2403.      ╔════════════════════════════════════════════════════════════════════╗
  2404.      ║ MODIFY [STRUCTURE]                                                 ║
  2405.      ╚════════════════════════════════════════════════════════════════════╝
  2406.  
  2407.           The command MODIFY (or MODIFY STRUCTURE) modifies the structure
  2408.      of the selected file.  The display is the same as in CREATE, the keys
  2409.      retain their meaning.  Each field is represented by four editing
  2410.      fields.
  2411.  
  2412.           All records in the file will be automatically appended.  If any
  2413.      types or names are changed, the contents of the affected fields will
  2414.      be lost.
  2415.  
  2416.      Restrictions:
  2417.  
  2418.           A.   Do not use MODIFY in a program
  2419.  
  2420.           B.   Do not use MODIFY merely to change the name of a field.
  2421.                Fields may be renamed instantaneously with the RENAME FIELD
  2422.                command.
  2423.  
  2424.           Editing keys:
  2425.  
  2426.      <Left> or Ctrl-S        moves the cursor back one character
  2427.      <Right> or Ctrl-D       moves the cursor forward one character
  2428.      Ctrl-<Left>             moves to the beginning of the editing field
  2429.      Ctrl-<Right>            moves to the end of the editing field
  2430.      <Ins> or Ctrl-V         puts you in insert mode: what you type gets
  2431.                                 inserted  (normally, you are in overtype
  2432.                                 mode: what you type overtypes the existing
  2433.                                 text); pressing <Ins> or Ctrl-V again, puts
  2434.                                 you back into overtype mode
  2435.      <BACKSPACE>             deletes the character to the left of the
  2436.                                 cursor
  2437.      <Del> or Ctrl-G         deletes the character on the cursor
  2438.      Ctrl-Y                  deletes the rest of the editing field
  2439.  
  2440.      <Up> or Ctrl-E          moves the cursor to the previous editing field
  2441.      <Dn> or Ctrl-X          moves the cursor to the next editing field
  2442.  
  2443.      Ctrl-Q                  quits and does not modify the file
  2444.      <End> or Ctrl-W         quits and modifies the file
  2445.  
  2446.      Ctrl-K                  moves back to the top of the previous page
  2447.      Ctrl-L                  moves to the top of the next page
  2448.  
  2449.  
  2450.  
  2451.  
  2452.      MODIFY                     VPI1  VPI  VPIN                      MODIFY      VP-Info Level 1 Reference Manual          Page 265          SECTION 4
  2453.  
  2454.  
  2455.      Ctrl-N                  inserts a new line
  2456.      Ctrl-T                  deletes the line
  2457.  
  2458.           To be safe, make a back up copy of the file to be modified before
  2459.      the MODIFY command is given.  After the MODIFY, the new fields will be
  2460.      blank, the deleted fields disappear.  All deleted records will also be
  2461.      lost.
  2462.  
  2463.           If <Esc> or Ctrl-Q is pressed at any time in MODIFY before the
  2464.      appending of records is completed, MODIFY will be aborted and the data
  2465.      file closed.  No changes already made will be saved.
  2466.  
  2467.           Changing the characteristics of a field (say the width) effects
  2468.      the field the same way as in APPEND FROM.
  2469.  
  2470.           On a network with SET NETWORK ON in VP-Info Professional Network
  2471.      Edition, attempting to MODIFY an index while another user is accessing
  2472.      a file with the same name will cause a LOCK error.  Always open a file
  2473.      in LOCK mode before modifying it.
  2474.  
  2475.           Example:
  2476.  
  2477.           Change the FNAME field in EMPLOYEE.DBF from 10 characters to 15
  2478.      characters.
  2479.  
  2480.      1>USE employee
  2481.      1>COPY employee to temp                    making a backup copy
  2482.      1>MODIFY
  2483.  
  2484. ──────────────────────────────────────────────────────────────────────────────
  2485. Thursday, March 22, 1990
  2486.                                  VP-Info Modify               EMPLOYEE.DBF
  2487. Name         Type    Width   Dec        Name         Type    Width   Dec
  2488.  
  2489. NAME          C       15      0
  2490. FNAME         C       10      0
  2491. ADDR          C       20      0
  2492. CITY          C       20      0
  2493. STATE         C        2      0
  2494. ZIP           C        6      0
  2495. TEL_NO        C       10      0
  2496. MARRIED       L        1      0
  2497. SALARY        N        9      2
  2498. YEAR_EMP      N        4      0
  2499. DEPT          C       15      0
  2500.  
  2501.  
  2502. ┌────────────────────────────────────────────────────────────────────────────┐
  2503. │ UP/DOWN           COLUMN MOVE  ROW            SAVE STRUCTURE    C..Strings │
  2504. │ previous. <PgUp>  left... ^K   insert... ^N   update... <End>   N..Numbers │
  2505. │ next..... <PgDn>  right.. ^L   delete... ^T   nochange. ^Q      L..Yes/No  │
  2506. └────────────────────────────────────────────────────────────────────────────┘
  2507. ──────────────────────────────────────────────────────────────────────────────
  2508.  
  2509.      MODIFY                     VPI1  VPI  VPIN                      MODIFY      VP-Info Level 1 Reference Manual          Page 266          SECTION 4
  2510.  
  2511.  
  2512.  
  2513.  
  2514.           Now change 10 to 15:
  2515.  
  2516.  
  2517. ──────────────────────────────────────────────────────────────────────────────
  2518. Thursday, March 22, 1990
  2519.                                  VP-Info Modify               EMPLOYEE.DBF
  2520. Name         Type    Width   Dec        Name         Type    Width   Dec
  2521.  
  2522. NAME          C       15      0
  2523. FNAME         C       15      0
  2524. ADDR          C       20      0
  2525. CITY          C       20      0
  2526. STATE         C        2      0
  2527. ZIP           C        6      0
  2528. TEL_NO        C       10      0
  2529. MARRIED       L        1      0
  2530. SALARY        N        9      2
  2531. YEAR_EMP      N        4      0
  2532. DEPT          C       15      0
  2533.  
  2534.  
  2535. ┌────────────────────────────────────────────────────────────────────────────┐
  2536. │ UP/DOWN           COLUMN MOVE  ROW            SAVE STRUCTURE    C..Strings │
  2537. │ previous. <PgUp>  left... ^K   insert... ^N   update... <End>   N..Numbers │
  2538. │ next..... <PgDn>  right.. ^L   delete... ^T   nochange. ^Q      L..Yes/No  │
  2539. └────────────────────────────────────────────────────────────────────────────┘
  2540. ──────────────────────────────────────────────────────────────────────────────
  2541.  
  2542.           When you press <End>, you are given the opportunity to change to
  2543.     data file "type" from the current type shown to any other.  Type 3 is the
  2544.     only one that can be read and changed by dBASE III, dBASE IV, FoxPro,
  2545.     Clipper, etc.
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.                           Page 267 intentionally omitted.
  2563.  
  2564.  
  2565.  
  2566.      MODIFY                     VPI1  VPI  VPIN                      MODIFY      VP-Info Level 1 Reference Manual          Page 268          SECTION 4
  2567.  
  2568.  
  2569.                                     NEAREST
  2570.  
  2571.      Find the first record whose index key is equal to or greater than a
  2572.      given FIND string by its index in the selected data file.
  2573.  
  2574.      ╔════════════════════════════════════════════════════════════════════╗
  2575.      ║ NEAREST <string>                                                   ║
  2576.      ║                          VP-Info Professional only                 ║
  2577.      ║                                                                    ║
  2578.      ║ <string>   the characters to match in the current master index     ║
  2579.      ╚════════════════════════════════════════════════════════════════════╝
  2580.  
  2581.           NEAREST is one of a family of commands that finds a record in an
  2582.      indexed data file by matching a given string with key values in the
  2583.      index file:
  2584.  
  2585.           NEAREST positions the file on the first record in the index equal
  2586.                to or greater than the FIND string (VP-Info Professional
  2587.                only).  If no key in the index is equal to or greater than
  2588.                the FIND string, the current record pointer and :NEAR are
  2589.                set to the bottom of file, and EOF is set to T (true)
  2590.           FIND positions the file on the first record in the index matching
  2591.                the LAST string (no-find positions the file at the top of
  2592.                file)
  2593.           LAST positions the file on the last record in the index matching
  2594.                the FIND string (VP-Info Professional only) (no-find
  2595.                positions the file at the top of file)
  2596.           SEEK is identical to FIND, except that it searches for the match
  2597.                to the value of a character expression instead of a string
  2598.                constant (VP-Info Professional only) (no-find positions the
  2599.                file at the top of file)
  2600.  
  2601.           All forms allow a search to be made on a character expression
  2602.      when the expression if preceded by the macro symbol "&".  When the
  2603.      variable var='TAYLOR', both of the following command lines are
  2604.      equivalent:
  2605.  
  2606.      NEAREST TAYLOR
  2607.      NEAREST &var
  2608.  
  2609.           In Conversational VP-Info Level 1, just type NEAREST and the key.
  2610.  
  2611.           Examples:
  2612.  
  2613.      1>NEAREST TAYLOR
  2614.      1>NEAREST TOM
  2615.  
  2616.           If SET DELETE ON, deleted records will not be found.  (See the
  2617.      command SET.)
  2618.  
  2619.           Numbers must always be treated as strings, even if the key
  2620.      expression is a numeric field.  If NUM is a numeric field of width 2,
  2621.  
  2622.  
  2623.      NEAREST                        VPI  VPIN                       NEAREST      VP-Info Level 1 Reference Manual          Page 269          SECTION 4
  2624.  
  2625.  
  2626.      NEAREST 1 will not find 1, but NEAREST &STR(1,2) or NEAREST &' 1' will
  2627.      be successful.
  2628.  
  2629.           For the users' convenience, Conversational VP-Info Level 1
  2630.      converts all command lines to upper case before execution.  So, to
  2631.      find the inventory numbers that start with AB, type either of the
  2632.      following two commands:
  2633.  
  2634.      1>NEAREST AB
  2635.      1>NEAREST ab
  2636.  
  2637.           It follows that
  2638.  
  2639.      1>NEAREST Taylor
  2640.  
  2641.      is understood by VP-Info Level 1 as NEAREST TAYLOR.  If you have to
  2642.      find Taylor, either use the string directly with the macro symbol:
  2643.  
  2644.      1>NEAREST &'Taylor'
  2645.  
  2646.      or if name='Taylor' use the following:
  2647.  
  2648.      1>NEAREST &name
  2649.  
  2650.           By definition, NEAREST is always successful (unless the file is
  2651.      empty).  If an exact match is found, both the current record pointer
  2652.      (as shown by the # and RECNO( functions) and the system variable :NEAR
  2653.      are set to the first matching record.
  2654.  
  2655.           If an exact match is not found, the current record pointer and
  2656.      the value of :NEAR will be set to the number of the first record in
  2657.      the index with a key greater than the FIND string; if the index
  2658.      contains no key greater than the FIND string, the current record
  2659.      pointer and :NEAR are set to the bottom of file, and EOF is set to T
  2660.      (true).
  2661.  
  2662.           To position the record pointer to the record equal to or
  2663.      immediately less than the FIND string, do the following:
  2664.  
  2665.      NEAREST &findstring
  2666.      IF keyexpr<findstring
  2667.         SKIP -1
  2668.      ENDIF
  2669.  
  2670.  
  2671.           Note to Level 1 programmers: In a Level 1 program, you can
  2672.      approximate the actions of NEAREST when FIND fails by shortening the
  2673.      FIND string one character at a time until either the FIND is
  2674.      successful or the FIND string disappears. For example, if the FIND
  2675.      string is stored in VAR:
  2676.  
  2677.  
  2678.  
  2679.  
  2680.      NEAREST                        VPI  VPIN                       NEAREST      VP-Info Level 1 Reference Manual          Page 270          SECTION 4
  2681.  
  2682.  
  2683.      finder2=finder
  2684.      DO WHILE len(finder2)>0
  2685.         FIND &finder2
  2686.         IF #>0
  2687.            BREAK
  2688.         ENDIF
  2689.         finder2=LEFT(finder2,LEN(finder2)-1)
  2690.      ENDDO
  2691.      IF #=0
  2692.         GOTO TOP
  2693.      ENDIF
  2694.  
  2695.           For a fuller discussion, see the FIND command.
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.  
  2714.  
  2715.  
  2716.  
  2717.  
  2718.  
  2719.  
  2720.  
  2721.  
  2722.  
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728.  
  2729.  
  2730.  
  2731.  
  2732.  
  2733.  
  2734.  
  2735.  
  2736.  
  2737.      NEAREST                        VPI  VPIN                       NEAREST      VP-Info Level 1 Reference Manual          Page 271          SECTION 4
  2738.  
  2739.  
  2740.  
  2741.                                    NOEFFECTS
  2742.  
  2743.      Suppress special effects.
  2744.  
  2745.      ╔════════════════════════════════════════════════════════════════════╗
  2746.      ║ NOEFFECTS                                                          ║
  2747.      ║                                                                    ║
  2748.      ║          VP-Info Professional only             VPI.SET file only   ║
  2749.      ║                                                                    ║
  2750.      ╚════════════════════════════════════════════════════════════════════╝
  2751.  
  2752.           This command in the VPI.SET file suppresses the special screen
  2753.      and sound effects used for the sign-on screen, as well as for the
  2754.      SCREEN, SOUND, and RING commands.
  2755.  
  2756.           Examples:
  2757.  
  2758.      NOEFFECTS
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.  
  2780.  
  2781.  
  2782.  
  2783.  
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.      NOEFFECTS                      VPI  VPIN                     NOEFFECTS      VP-Info Level 1 Reference Manual          Page 272          SECTION 4
  2795.  
  2796.  
  2797.  
  2798.                                       NOTE
  2799.  
  2800.      Add notes to VP-Info Level 1 programs.
  2801.  
  2802.      ╔════════════════════════════════════════════════════════════════════╗
  2803.      ║ NOTE [<string>]                                                    ║
  2804.      ╟────────────────────────────────────────────────────────────────────╢
  2805.      ║ Option:                                                            ║
  2806.      ║                                                                    ║
  2807.      ║ <string>   any text line: the comment                              ║
  2808.      ╚════════════════════════════════════════════════════════════════════╝
  2809.  
  2810.           This is the same as the command * (see *).  Any VP-Info Level 1
  2811.      command line that starts with NOTE is ignored by VP-Info Level 1.
  2812.  
  2813.           Notes can also be added with semicolon(;) to any VP-Info Level 1
  2814.      command line
  2815.  
  2816.           Since notes are not compiled, they have no effect on the
  2817.      execution of programs.  Comments should be used liberally to help you
  2818.      (and possibly others) understand your programs later.  If programs are
  2819.      very large, however, some comments may have to be shortened or
  2820.      eliminated to allow the compiler and/or WRITE to load them properly.
  2821.  
  2822.           Examples:
  2823.  
  2824.      NOTE This is the start of the main menu display
  2825.      IF cust=mcust ;the start of the processing for the current customer
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.      NOTE                       VPI1  VPI  VPIN                        NOTE      VP-Info Level 1 Reference Manual          Page 273          SECTION 4
  2852.  
  2853.  
  2854.  
  2855.                                     NOUPDATE
  2856.  
  2857.      Do not write changes made to the current record back to the disk.
  2858.  
  2859.      ╔════════════════════════════════════════════════════════════════════╗
  2860.      ║ NOUPDATE                                                           ║
  2861.      ╚════════════════════════════════════════════════════════════════════╝
  2862.  
  2863.           Whenever a change is made to the current record in an open data
  2864.      file, leaving the record or closing the file causes the changes to be
  2865.      written to the disk.  This automatic action can be overridden by the
  2866.      NOUPDATE command, which tells VP-Info Level 1 to ignore the changes.
  2867.  
  2868.           This is essentially what happens when Ctrl-Q is pressed during
  2869.      EDIT and BROWSE.
  2870.  
  2871.           Example in a program:
  2872.  
  2873.           Suppose full-screen editing is in effect with the READ command,
  2874.      and you want to ignore any changes made to the record if the user
  2875.      presses Ctrl-Q or an erroneous key like Ctrl-T and Ctrl-U.  Using the
  2876.      :KEY system variable that stores the key number of the key pressed to
  2877.      terminate the last process:
  2878.  
  2879.      DO WHILE t
  2880.         READ
  2881.         IF :key=17 .OR. :key=20 .OR. :key=21  ;key numbers of ^Q, ^T and ^U
  2882.            NOUPDATE
  2883.            LOOP
  2884.         ENDIF
  2885.         DO CASE
  2886.         CASE :key=...                         ;check a key
  2887.            ...                                ;action based on :key value
  2888.         ENDCASE
  2889.      ENDDO
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.      NOUPDATE                   VPI1  VPI  VPIN                    NOUPDATE      VP-Info Level 1 Reference Manual          Page 274          SECTION 4
  2909.  
  2910.  
  2911.  
  2912.                                     ON ERROR
  2913.  
  2914.      Tell VP-Info Level 1 what to do if an error is encountered during
  2915.      program execution.
  2916.  
  2917.      ╔════════════════════════════════════════════════════════════════════╗
  2918.      ║ ON ERROR                                                           ║
  2919.      ╚════════════════════════════════════════════════════════════════════╝
  2920.  
  2921.           The command ON ERROR starts the ON ERROR/ENDON structure.  There
  2922.      can be any program segment between ON ERROR and ENDON, except that no
  2923.      data files should be opened or closed, and no new variables created or
  2924.      released.  This program segment is executed whenever the program
  2925.      encounters an error.
  2926.  
  2927.           The ON ERROR is in effect in the program from the point where it
  2928.      is located.  It remains in effect until another ON ERROR structure is
  2929.      found, or until execution leaves the current module, either on a
  2930.      RETURN or DO command.
  2931.  
  2932.           ON ERROR has no effect within a subroutine called by the DO
  2933.      command; if the subroutine needs the same ON ERROR structure, repeat
  2934.      the structure in the subroutine.
  2935.  
  2936.           Since the ON ERROR structure has no effect after returning to a
  2937.      calling program from a subroutine, you should consider putting this
  2938.      structure (possibly together with the ON ESCAPE structure) into a
  2939.      procedure that is performed at the beginning of the program, and after
  2940.      every DO command.
  2941.  
  2942.           ON ERROR should normally include a RETURN, CHAIN, CANCEL, or QUIT
  2943.      command to allow execution to leave the current program.  Do not
  2944.      RETURN from a main return, or CHAIN from a subroutine.
  2945.  
  2946.           When editing with the internal VP-Info Level 1 programming editor
  2947.      (see WRITE command), Alt-F reformats the file with all structures
  2948.      properly indented, making it easy to see unbalanced structures.
  2949.  
  2950.           Example:
  2951.  
  2952.      ON ERROR
  2953.         ? 'Aborting program execution because Error',:error,'encountered'
  2954.         ? :message      ;  :error contains the latest error number, and
  2955.         ?               ;  :message contains its meaning
  2956.         RING
  2957.         CANCEL
  2958.      ENDON
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.      ON ERROR                   VPI1  VPI  VPIN                    ON ERROR      VP-Info Level 1 Reference Manual          Page 275          SECTION 4
  2966.  
  2967.  
  2968.  
  2969.                                    ON ESCAPE
  2970.  
  2971.      Tell VP-Info Level 1 what to do if the user presses <Esc>.
  2972.  
  2973.      ╔════════════════════════════════════════════════════════════════════╗
  2974.      ║ ON ESCAPE                                                          ║
  2975.      ╚════════════════════════════════════════════════════════════════════╝
  2976.  
  2977.           The command ON ESCAPE starts the ON ESCAPE/ENDON structure.
  2978.      There can be any program segment between ON ESCAPE and ENDON, except
  2979.      that no data files should be opened or closed, and no new variables
  2980.      created or released.  This program segment is executed whenever the
  2981.      user presses <Esc>.
  2982.  
  2983.           The ON ESCAPE is in effect in the program from the point where it
  2984.      is located.  It remains in effect until another ON ESCAPE structure is
  2985.      found, or until execution leaves the current module, either on a
  2986.      RETURN or DO command.
  2987.  
  2988.           ON ESCAPE has no effect within a subroutine called by the DO
  2989.      command; if the subroutine needs the same ON ESCAPE structure, repeat
  2990.      the structure in the subroutine.
  2991.  
  2992.           Since the ON ESCAPE structure has no effect after returning to a
  2993.      calling program from a subroutine, you should consider putting this
  2994.      structure (possibly together with the ON ERROR structure) into a
  2995.      procedure that is performed at the beginning of the program, and after
  2996.      every DO command.
  2997.  
  2998.           ON ESCAPE should normally include a RETURN, CHAIN, CANCEL, or
  2999.      QUIT command to allow execution to leave the current program.
  3000.  
  3001.           When editing with the internal VP-Info Level 1 programming editor
  3002.      (see WRITE command), Alt-F reformats the file with all structures
  3003.      properly indented, making it easy to see unbalanced structures.
  3004.  
  3005.           Example:
  3006.  
  3007.      ON ESCAPE
  3008.         ? 'Aborting program execution because <Esc> key pressed.'
  3009.         RING
  3010.         CANCEL
  3011.      ENDON
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.      ON ESCAPE                  VPI1  VPI  VPIN                   ON ESCAPE      VP-Info Level 1 Reference Manual          Page 276          SECTION 4
  3023.  
  3024.  
  3025.  
  3026.                                     ON FIELD
  3027.  
  3028.      Control the processing of data input during execution of the full-
  3029.      screen editing commands: READ, EDIT, APPEND, and BROWSE.
  3030.  
  3031.      ╔════════════════════════════════════════════════════════════════════╗
  3032.      ║ ON FIELD                                                           ║
  3033.      ╚════════════════════════════════════════════════════════════════════╝
  3034.  
  3035.           The command ON FIELD starts the ON FIELD/ENDON structure.  There
  3036.      can be any program segment between ON FIELD and ENDON, except that no
  3037.      data files should be opened or closed, and no new variables created or
  3038.      released.
  3039.  
  3040.           Inside the ON FIELD structure is a number of FIELD statements,
  3041.      each telling VP-Info Level 1 what to do when the user leaves a
  3042.      specific field, enters a new record, or leaves the record.  There can
  3043.      be one FIELD statement for each input field in a Get Table, in
  3044.      addition to the two FIELD statements controlling entry and exit from
  3045.      READ (or the current record in EDIT and BROWSE).
  3046.  
  3047.            (Note that the term editing field does not refer in this case
  3048.      only to fields, but to the on-screen area where you're expected to
  3049.      enter or edit data; an editing field may be a "window into" a data-
  3050.      file field, a memory variable, or a system variable.  An element in a
  3051.      matrix cannot be accessed with the full-screen editing commands, so
  3052.      cannot be tied to an editing field.)
  3053.  
  3054.           ON FIELD is used primarily for the following three functions:
  3055.  
  3056.           A.   To verify data input.  If the value entered does not meet a
  3057.                condition, the cursor can be directed back to the current
  3058.                field with the :FIELD=FIELD(fieldname) command.
  3059.  
  3060.           B.   To do data lookups from the selected or other files. For
  3061.                example, suppose the first field in the screen is mcust;
  3062.                when a customer number is entered FIND &mcust is executed
  3063.                and the proper record found in the current file.  If an
  3064.                invoice number is entered, data can be retrieved from the
  3065.                proper invoice with a FIND into another indexed file.
  3066.  
  3067.           C.   To change the order in which the cursor goes to the next
  3068.                field.  For example, a TEXT can have three columns of input
  3069.                figures; VP-Info Level 1 normally goes left to right on each
  3070.                line, and then top to bottom, but appropriate use of the
  3071.                :FIELD system variable can direct the cursor to do one
  3072.                column at a time.
  3073.  
  3074.           The form of the ON FIELD structure:
  3075.  
  3076.  
  3077.  
  3078.  
  3079.      ON FIELD                   VPI1  VPI  VPIN                    ON FIELD      VP-Info Level 1 Reference Manual          Page 277          SECTION 4
  3080.  
  3081.  
  3082.  
  3083.      ON FIELD
  3084.      FIELD 0
  3085.         <initiating command sequence>   ;The FIELD 0 code is executed when
  3086.                                           READ is entered or whenever a new
  3087.                                           record is entered in BROWSE OFF,
  3088.                                           EDIT OFF, etc.
  3089.      Field 1
  3090.         <command sequence 1>            ;The FIELD 1 code is executed when
  3091.                                           the cursor leaves the first
  3092.                                           editing field (and again when the
  3093.                                           current record is exited provided
  3094.                                           SET EXECUTE ON).
  3095.      Field 2
  3096.         <command sequence 2>            ;The FIELD 2 code is executed when
  3097.                                           the cursor leaves the second
  3098.                                           editing field (and again when the
  3099.                                           current record is exited provided
  3100.                                           SET EXECUTE ON).
  3101.      Field <n>
  3102.         <command sequence <n>>          ;The FIELD <n> code is executed
  3103.                                           when the cursor leaves the nth
  3104.                                           (final) editing field (and again
  3105.                                           when the current record is exited
  3106.                                           provided SET EXECUTE ON).
  3107.      Field 65
  3108.         <command sequence 65>           ;The FIELD 1 code is executed when
  3109.                                           the cursor leaves READ or when
  3110.                                           the current record is exited in
  3111.                                           BROWSE OFF, EDIT OFF, etc.
  3112.      ENDON
  3113.  
  3114.           Fields 1 through 64 may be referenced either by number of by the
  3115.      name of the field or variable being edited.  Names are usually more
  3116.      understandable and always more flexible, since a field can later be
  3117.      added or omitted without having to renumber the entire ON FIELD
  3118.      structure.
  3119.  
  3120.           You can force VP-Info Level 1 to execute the entire set of FIELD
  3121.      commands from 1 through 64 by SET EXECUTION ON.  The default is OFF.
  3122.      Do not use ON if there is a possibility of creating an endless loop
  3123.      which doesn't allow a graceful exit.
  3124.  
  3125.           The Get Table is usually canceled as soon as execution leaves the
  3126.      current program, even when just executing a subroutine with the DO
  3127.      command.  You can SET GET ON to maintain the Get Table, provided it is
  3128.      not cleared in the sub-program.  (A Get Table is cleared either with
  3129.      the CLEAR GETS command, or by creating a GET with TEXT or an @ GET
  3130.      command after a READ command.)  The default is SET GET OFF.
  3131.  
  3132.  
  3133.  
  3134.  
  3135.  
  3136.      ON FIELD                   VPI1  VPI  VPIN                    ON FIELD      VP-Info Level 1 Reference Manual          Page 278          SECTION 4
  3137.  
  3138.  
  3139.           When editing with the internal VP-Info Level 1 programming editor
  3140.      (see WRITE command), Alt-F reformats the file with all structures
  3141.      properly indented, making it easy to see unbalanced structures.
  3142.  
  3143.           Example:
  3144.  
  3145.      date1=date(1)
  3146.      CLS
  3147.      TEXT
  3148.      .. date1,99/99/99
  3149.                     Enter game date (must be a Wednesday)
  3150.  
  3151.                                 @date1
  3152.      ENDTEXT
  3153.      ON FIELD
  3154.      FIELD date1
  3155.         IF DATE(FULL,date1)<>"W"
  3156.            :field=FIELD(date1)          ;use FIELD( to get correct number
  3157.         ENDIF
  3158.      ENDON
  3159.      DO WHILE t
  3160.         READ
  3161.         <command modules>
  3162.      ENDDO
  3163.  
  3164.           Note the placement of the three elements: the TEXT with its input
  3165.      macro and the ON FIELD come before the READ or other full-screen
  3166.      editing command, and are usually outside the DO WHILE loop unless the
  3167.      screen is rewritten elsewhere inside the loop.
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.  
  3176.  
  3177.  
  3178.  
  3179.  
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  
  3192.  
  3193.      ON FIELD                   VPI1  VPI  VPIN                    ON FIELD      VP-Info Level 1 Reference Manual          Page 279          SECTION 4
  3194.  
  3195.  
  3196.  
  3197.                                    OTHERWISE
  3198.  
  3199.      Introduce the optional clause in a DO CASE program structure.
  3200.      ╔════════════════════════════════════════════════════════════════════╗
  3201.      ║ OTHERWISE                                                          ║
  3202.      ╚════════════════════════════════════════════════════════════════════╝
  3203.  
  3204.           In a DO CASE program structure, if no condition is true,
  3205.      VP-Info Level 1 executes the program segment following the OTHERWISE
  3206.      command, if any.  Only one OTHERWISE command is permitted within any
  3207.      DO CASE structure; it is equivalent to CASE t (true).
  3208.  
  3209.           See under DO CASE.
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250.      OTHERWISE                  VPI1  VPI  VPIN                   OTHERWISE      VP-Info Level 1 Reference Manual          Page 280          SECTION 4
  3251.  
  3252.  
  3253.  
  3254.                                   OVERWRITE TO
  3255.  
  3256.      Copy the fields from a record in one data file directly into the
  3257.      current record of another data file.
  3258.  
  3259.      ╔════════════════════════════════════════════════════════════════════╗
  3260.      ║ OVERWRITE TO [<filenum>]                                           ║
  3261.      ║                           VP-Info Professional only                ║
  3262.      ║                                                                    ║
  3263.      ║ <filenum>   any number of the data file containing the record to   ║
  3264.      ║               be overwritten                                       ║
  3265.      ╚════════════════════════════════════════════════════════════════════╝
  3266.  
  3267.           The OVERWRITE TO command is primarily used to implement
  3268.      transaction processing and to avoid lengthy record locks while records
  3269.      are being edited in a network environment.  Its companion command is
  3270.      APPEND TO.
  3271.  
  3272.          The technique in both cases is essentially the same, utilizing a
  3273.      main, indexed file and a small, unindexed personal file for each
  3274.      operator.
  3275.  
  3276.          The operator edits only in the personal file, adding records as
  3277.      required and verifying that everything is correct before moving the
  3278.      data back into the main file.  If the records already exist in the
  3279.      main file, OVERWRITE TO is used to put the corrected records back
  3280.      where they came from; if new records were appended to the personal
  3281.      file, APPEND TO is used to add them to the end of the main file.
  3282.  
  3283.           The two files do not need to have the same structures.  Any
  3284.      fields which do not exist in both files will be unaffected; any that
  3285.      are smaller in one than the other create risks of losing some data due
  3286.      to string truncation or numeric overflow.
  3287.  
  3288.           Executing OVERWRITE TO is much faster than a long series of
  3289.      REPLACE commands.
  3290.  
  3291.           Example in a program with SET NETWORK ON (VP-Info Professional
  3292.      Network Edition only):
  3293.  
  3294.      USE customer INDEX custnum,custname SHARE
  3295.      USE#2 personal
  3296.      SET FUNCTION OFF
  3297.      DO WHILE t
  3298.         SET SAVE OFF
  3299.         EDIT TEXT customer      ;use formatted EDIT
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.      OVERWRITE TO                   VPI  VPIN                  OVERWRITE TO      VP-Info Level 1 Reference Manual          Page 281          SECTION 4
  3308.  
  3309.  
  3310.         IF usedby<>0
  3311.            WINDOW 20,30,22,75 DOUBLE   ;pop up a window for message
  3312.            recnum=RECNO(1)
  3313.            TEXT
  3314.      .. recnum,'999,999'
  3315.      .. usedby,999
  3316.          Record &recnum is in use by user &usedby
  3317.  
  3318.          Press any key to skip to next record...
  3319.            ENDTEXT
  3320.            junk=INKEY()               ;wait to keystroke
  3321.            SKIP
  3322.            LOOP
  3323.         ENDIF
  3324.         IF :key=324                   ;F10 means edit this record
  3325.            REPLACE usedby with :USER  ;mark record as in use by you
  3326.            OVERWRITE TO 2             ;then move into personal file
  3327.            SELECT 2                   ;select personal file
  3328.            SET SAVE ON                ;allow changes to be saved
  3329.            CLS                        ;clear the screen
  3330.            TEXT custedit              ;with "CHANGES PERMITTED" message
  3331.            READ
  3332.            WINDOW 20,30,22,75 DOUBLE  ;pop up a window for confirmation
  3333.            ans='No '
  3334.            recnum=RECNO(1)
  3335.            TEXT
  3336.      .. recnum,'999,999'
  3337.      ..,ans,!xx
  3338.          Changes may have been made to record #recnum
  3339.  
  3340.               Save all changes (Yes/No)  @ans
  3341.            ENDTEXT
  3342.            IF ans='Y'
  3343.               OVERWRITE to 1
  3344.            ENDIF
  3345.            REPLACE usedby with 0      ;free the record for other users
  3346.         ENDIF
  3347.      ENDDO
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362.  
  3363.  
  3364.      OVERWRITE TO                   VPI  VPIN                  OVERWRITE TO      VP-Info Level 1 Reference Manual          Page 282          SECTION 4
  3365.  
  3366.  
  3367.  
  3368.                                       PACK
  3369.  
  3370.      Remove deleted records from the selected file.
  3371.  
  3372.      ╔════════════════════════════════════════════════════════════════════╗
  3373.      ║ PACK [TRUNCATE]                                                    ║
  3374.      ╟────────────────────────────────────────────────────────────────────╢
  3375.      ║ Option:                                                            ║
  3376.      ║                                                                    ║
  3377.      ║ TRUNCATE   reduce the DOS size of the file                         ║
  3378.      ╚════════════════════════════════════════════════════════════════════╝
  3379.  
  3380.           This command removes records that have been marked for deletion
  3381.      by the DELETE command or the Ctrl-U of the EDIT and BROWSE commands.
  3382.  
  3383.           All the index files in use are automatically reindexed after
  3384.      PACK. (See INDEX and REINDEX.)
  3385.  
  3386.           Make sure you have a back up copy of the file before packing it.
  3387.      If PACK is interrupted, the file may be corrupt or contain duplicate
  3388.      records.
  3389.  
  3390.           PACK does not release disk space unless the TRUNCATE option is
  3391.      used.  If a file frequently gets large, has many records deleted and
  3392.      then grows again, it may be more efficient to PACK without TRUNCATE,
  3393.      so that DOS is not constantly adding disk clusters and recovering them
  3394.      again.
  3395.  
  3396.           On a network with SET NETWORK ON in VP-Info Professional Network
  3397.      Edition, attempting to PACK or create an index while another user is
  3398.      accessing the data file or an index file with the same name as any of
  3399.      the current indexes will cause a LOCK error.  Always LOCK the data
  3400.      file before attempting to PACK.
  3401.  
  3402.           Examples:
  3403.  
  3404.      1>USE employee
  3405.      1>GO 2
  3406.      1>DELETE
  3407.            1 DELETE(S)
  3408.      1>LIST name
  3409.            1  Marek
  3410.            2 *Balzer
  3411.            3  Steiner
  3412.            4  Rayme
  3413.            5  Poyner
  3414.            6  Wilson
  3415.      1>PACK
  3416.            5 TOTAL PACKED
  3417.      1>LIST name
  3418.  
  3419.  
  3420.  
  3421.      PACK                       VPI1  VPI  VPIN                        PACK      VP-Info Level 1 Reference Manual          Page 283          SECTION 4
  3422.  
  3423.  
  3424.            1  Marek
  3425.            2  Steiner
  3426.            3  Rayme
  3427.            4  Poyner
  3428.            5  Wilson
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446.  
  3447.  
  3448.  
  3449.  
  3450.  
  3451.  
  3452.  
  3453.  
  3454.  
  3455.  
  3456.  
  3457.  
  3458.  
  3459.  
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466.  
  3467.  
  3468.  
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474.  
  3475.  
  3476.  
  3477.  
  3478.      PACK                       VPI1  VPI  VPIN                        PACK      VP-Info Level 1 Reference Manual          Page 284          SECTION 4
  3479.  
  3480.  
  3481.  
  3482.                                     PERFORM
  3483.  
  3484.      Execute a procedure.
  3485.  
  3486.      ╔════════════════════════════════════════════════════════════════════╗
  3487.      ║ PERFORM <procedure>                                                ║
  3488.      ║                                                                    ║
  3489.      ║ <procedure>      the name of the procedure                         ║
  3490.      ╚════════════════════════════════════════════════════════════════════╝
  3491.  
  3492.           The command PERFORM is used to execute a procedure, <procedure>,
  3493.      defined in the current program; <procedure> cannot be a macro.  The
  3494.      procedure is defined with the PROCEDURE command (see PROCEDURE).
  3495.  
  3496.           The procedure is compiled where it is first called with PERFORM.
  3497.      If the procedure makes references to fields, the structure and order
  3498.      of the files in use must be the same any time the procedure is used.
  3499.      The same comment also applies to memory variables.  Normally,
  3500.      procedures perform tasks that are independent of the environment
  3501.      (files in use and memory variables) or they are always invoked in the
  3502.      same environment.
  3503.  
  3504.           If you need the same procedure in different environments, write
  3505.      the procedure as a separate program, and invoke it as a subroutine
  3506.      with the DO command.  See the command DO.
  3507.  
  3508.           Performing procedures is a very fast way of executing the same
  3509.      program segment from many places in the program.  The procedures
  3510.      themselves must be at the end of the program.
  3511.  
  3512.           Example:
  3513.  
  3514.      PERFORM header
  3515.      DO WHILE .NOT. EOF
  3516.         ...
  3517.         line=line+1
  3518.         IF line>55
  3519.           PERF header
  3520.         ENDIF
  3521.      ENDDO
  3522.      CHAIN menu
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530.  
  3531.  
  3532.  
  3533.  
  3534.  
  3535.      PERFORM                    VPI1  VPI  VPIN                     PERFORM      VP-Info Level 1 Reference Manual          Page 285          SECTION 4
  3536.  
  3537.  
  3538.      PROCEDURE header
  3539.         TEXT
  3540.      &:DATE                             &:COMPANY                Page &page
  3541.                                       Sales Journal
  3542.  
  3543.      Date    Invoice #  Description                     Units     Dollars
  3544.  
  3545.         ENDTEXT
  3546.         line=6
  3547.      ENDPROCEDURE
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554.  
  3555.  
  3556.  
  3557.  
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.  
  3572.  
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578.  
  3579.  
  3580.  
  3581.  
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588.  
  3589.  
  3590.  
  3591.  
  3592.      PERFORM                    VPI1  VPI  VPIN                     PERFORM      VP-Info Level 1 Reference Manual          Page 286          SECTION 4
  3593.  
  3594.  
  3595.  
  3596.                                       POST
  3597.  
  3598.      Post the FROM (transaction) file to the POSTING file (selected file
  3599.      with index).
  3600.  
  3601.      ╔════════════════════════════════════════════════════════════════════╗
  3602.      ║ POST ON <str exp> FROM <file> [FIELDS <mixed field list>] [<scope>]║
  3603.      ║      [FOR <cond>]                                                  ║
  3604.      ║                                                                    ║
  3605.      ║ <str exp>   the expression that is the key for finding the records ║
  3606.      ║                in the FROM file                                    ║
  3607.      ║ <file>      the FROM file                                          ║
  3608.      ╟────────────────────────────────────────────────────────────────────╢
  3609.      ║ Options:                                                           ║
  3610.      ║                                                                    ║
  3611.      ║ FIELDS <mixed field list>  the fields to be totalled in the        ║
  3612.      ║                       FROM file and added to the fields            ║
  3613.      ║                       in the POSTING file (the selected file);     ║
  3614.      ║                       <field> WITH <num exp> can add an expression ║
  3615.      ║ <scope>            selection restricted by scope                   ║
  3616.      ║                       (default scope: ALL)                         ║
  3617.      ║ FOR <cond>         selection restricted by <cond>                  ║
  3618.      ╚════════════════════════════════════════════════════════════════════╝
  3619.  
  3620.           The selected file, called the POSTING file, must be indexed by
  3621.      <str exp>, an expression formed from fields of the FROM file, called
  3622.      the FROM file, and constants and memory variables.
  3623.  
  3624.           This procedure takes all the appropriate records (that is, the
  3625.      first record satisfying the <cond> and within the scope) of the FROM
  3626.      file, one at a time.  It picks the first appropriate record, and
  3627.      evaluates <str exp> in the FROM file.  Next it finds the matching
  3628.      record in the POSTING file.  If the find is not successful, an error
  3629.      message POST ERROR" is sent.
  3630.  
  3631.           If the find is successful, the procedure posts.  Posting consists
  3632.      of one of two actions, depending on whether a field name is listed
  3633.      alone in the mixed field list, or if a field name has a WITH clause
  3634.      attached.
  3635.  
  3636.           A.   If the field is named alone, the value of that field in the
  3637.                FROM file is added to the value already in the POSTING
  3638.                file.; that is, it adds the fields in the <field list> of
  3639.                the current record of the FROM file to the fields of the
  3640.                same name in the current record of the POSTING file.
  3641.  
  3642.           B.   In a mixed field list, the clause <field> WITH <num exp>
  3643.                allows adding any numeric expression <field> to the field in
  3644.                the POSTING file.  <num exp> is formed using the fields of
  3645.                the FROM file, and optionally fields from other files
  3646.                (including the POSTING file), variables, and constants.
  3647.  
  3648.  
  3649.      POST                       VPI1  VPI  VPIN                        POST      VP-Info Level 1 Reference Manual          Page 287          SECTION 4
  3650.  
  3651.  
  3652.  
  3653.           If a find is unsuccessful and SET ADD ON, a record will be
  3654.      appended to the POSTING file, the non-numeric fields of the POSTING
  3655.      file record will be replaced by the matching fields in the FROM file
  3656.      record, and, finally, the procedure posts as above.
  3657.  
  3658.           The procedure continues with the next appropriate record of the
  3659.      FROM file.
  3660.  
  3661.           If there is no FIELDS clause, POST simply checks whether there is
  3662.      a record in the POSTING file for each value of <str exp> in the FROM
  3663.      file.  This is valuable to check whether every record in the FROM file
  3664.      has a matching record in the POSTING file without changing any fields.
  3665.  
  3666.           If SET PRINT OFF (the default), the error messages appear on the
  3667.      screen; otherwise, they are echoed to (printed on) the printer (or to
  3668.      the alternate text file, if SET ALTERNATE ON).
  3669.  
  3670.           Deleted records are not posted, irrespective of SET DELETED.
  3671.  
  3672.           Important programming note: The POST command automatically opens
  3673.      the FROM file in its internal work area; if the FROM file is already
  3674.      open in another work area, the compiler will assume it is closed when
  3675.      the POST command is passed during execution, even if that command is
  3676.      in an IF, CASE or other structure module that is not executed!
  3677.  
  3678.           Therefore, if there is any reference to the FROM file later in
  3679.      the program, open the file in the proper work area again immediately
  3680.      after the POST command.  If it is not actually needed after the POST
  3681.      is executed (e.g., the program exits after the POST), open it with the
  3682.      COMPILE keyword.  Example:
  3683.  
  3684.      USE#4 invoices COMPILE
  3685.  
  3686.           See also the related commands: TOTAL and UPDATE.
  3687.  
  3688.           Example:
  3689.  
  3690.           Use the data files SALESMEN and ORDER (see Appendix), to record
  3691.      the amount of merchandise sold.
  3692.  
  3693.      1>SET TALK ON
  3694.      1>USE salesmen
  3695.      1>INDEX ON slsman:no TO salesmen
  3696.            2 RECORDS IN TOTAL INDEXED
  3697.      1>POST ON slsman:no FROM order FIELDS amount FROM order
  3698.                                     2 ** POST ERROR ** 4
  3699.            5 POST(S)
  3700.      1>LIST
  3701.            1  1   Smith           John              4386.00
  3702.            2  5   Willson         Tom              14679.50
  3703.  
  3704.  
  3705.  
  3706.      POST                       VPI1  VPI  VPIN                        POST      VP-Info Level 1 Reference Manual          Page 288          SECTION 4
  3707.  
  3708.  
  3709.  
  3710.           The error message POST ERROR indicates that in the ORDER file
  3711.      there is a record (number 2) with a salesman code ("4") not found in
  3712.      the SALESMEN file.
  3713.  
  3714.           Note that the amount for Smith is 2709.00 (the amount that was in
  3715.      the SALESMEN file) +1677.00 (the amount in ORDER record 5).
  3716.  
  3717.           The amount for Willson is 12089.00 (the amount that was in the
  3718.      SALESMEN file) +597.50 (the amount in order 1) +559.00 (the amount in
  3719.      order 3) +1434.00 (the amount in order 4).
  3720.  
  3721.           Of course, the most typical example of the use of the command
  3722.      POST is posting to a general ledger (the POSTING file) from a journal
  3723.      (the transaction file).
  3724.  
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.  
  3755.  
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.      POST                       VPI1  VPI  VPIN                        POST      VP-Info Level 1 Reference Manual          Page 289          SECTION 4
  3764.  
  3765.  
  3766.  
  3767.                                    PROCEDURE
  3768.  
  3769.      Procedure (subroutine) definition.
  3770.  
  3771.      ╔════════════════════════════════════════════════════════════════════╗
  3772.      ║ PROCEDURE <procedure>                                              ║
  3773.      ║                                                                    ║
  3774.      ║ <procedure>   the name of the procedure                            ║
  3775.      ╚════════════════════════════════════════════════════════════════════╝
  3776.  
  3777.           The PROCEDURE command indicates the start of a procedure
  3778.      definition, the ENDPROCEDURE command indicates the end of the
  3779.      procedure:
  3780.  
  3781.      PROCEDURE <procedure>
  3782.        <program segment>
  3783.      ENDPROCEDURE
  3784.  
  3785.           Procedures should be used for all VP-Info Level 1 program
  3786.      segments that are used more than once in a program.  However, if the
  3787.      procedure makes references to fields, the structure and order of the
  3788.      files in use must be the same any time the procedure is used.  The
  3789.      same comment also applies to memory variables.  Normally, procedures
  3790.      perform tasks that are independent of the environment (files in use
  3791.      and memory variables) or they are always invoked in the same
  3792.      environment.
  3793.  
  3794.           If the whole program will not fit in memory, then replace the
  3795.      procedures by subroutines invoked by the DO command.  (See CHAIN,
  3796.      PERFORM, PROCEDURE.
  3797.  
  3798.           The procedure name, <procedure>, follows the same rules as
  3799.      variable names  (see Section 2); <procedure> cannot be a macro.
  3800.      Procedures must be placed at the end of the program.  A procedure can
  3801.      perform other procedures.
  3802.  
  3803.           A procedure is compiled at the first PERFORM invoking it.  (See
  3804.      Example 1 in Appendix A)
  3805.  
  3806.           Hint: If the same procedure must be used in more than one
  3807.      subroutine, add a digit (1, 2, 3, etc.) to the name in the various
  3808.      subroutines.  Example: if a procedure called BELL is needed in main
  3809.      program ENTER and subroutines ENTER1 and ENTER2, call it BELL, BELL1
  3810.      and BELL2 in the three program modules respectively.
  3811.  
  3812.           Examples:
  3813.  
  3814.           1. A simple label printing procedure.
  3815.  
  3816.      INPUT 'Enter the number of labels to print ' TO nlabel
  3817.  
  3818.  
  3819.  
  3820.      PROCEDURE                  VPI1  VPI  VPIN                   PROCEDURE      VP-Info Level 1 Reference Manual          Page 290          SECTION 4
  3821.  
  3822.  
  3823.      REPEAT nlabel TIMES
  3824.         PERFORM label
  3825.         SKIP
  3826.      ENDREPEAT
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.  
  3837.  
  3838.  
  3839.  
  3840.  
  3841.  
  3842.  
  3843.  
  3844.  
  3845.  
  3846.  
  3847.  
  3848.  
  3849.  
  3850.  
  3851.  
  3852.  
  3853.  
  3854.  
  3855.  
  3856.  
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872.  
  3873.  
  3874.  
  3875.  
  3876.  
  3877.      PROCEDURE                  VPI1  VPI  VPIN                   PROCEDURE      VP-Info Level 1 Reference Manual          Page 291          SECTION 4
  3878.  
  3879.  
  3880.      PROCEDURE label  ; prints 5 lines of data and 4 blank lines
  3881.         ? name        ; on standard labels one across
  3882.         ? add:1
  3883.         ? add:2
  3884.         ? add:3
  3885.         ? postal
  3886.         ?
  3887.         ?
  3888.         ?
  3889.         ?
  3890.      ENDPROCEDURE   ; end of label printing
  3891.  
  3892.           2. A procedure to clear screen, make border, set standard
  3893.      heading, and create reverse video black for menu choices.  This
  3894.      procedure would be called before any menu display in the program.
  3895.  
  3896.      PROCEDURE MENUSCREEN
  3897.         ERASE
  3898.         WINDOW 2,1,23,77 DOUBLE
  3899.         COLOR 112, 6, 4, 22, 74
  3900.         @ 3,0 SAY CEN(:COMPANY, 80)
  3901.         @ 5,0 SAY CEN('Enter your choice below:',80)
  3902.      ENDPROCEDURE menuscreen
  3903.  
  3904.  
  3905.  
  3906.  
  3907.  
  3908.  
  3909.  
  3910.  
  3911.  
  3912.  
  3913.  
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922.  
  3923.  
  3924.  
  3925.  
  3926.  
  3927.  
  3928.  
  3929.  
  3930.  
  3931.  
  3932.  
  3933.  
  3934.      PROCEDURE                  VPI1  VPI  VPIN                   PROCEDURE      VP-Info Level 1 Reference Manual          Page 292          SECTION 4
  3935.  
  3936.  
  3937.  
  3938.                                       QUIT
  3939.  
  3940.      Leave VP-Info Level 1.
  3941.  
  3942.      ╔════════════════════════════════════════════════════════════════════╗
  3943.      ║ QUIT [<errorlevel>]                                                ║
  3944.      ║                                                                    ║
  3945.      ╟────────────────────────────────────────────────────────────────────╢
  3946.      ║ Option:                                                            ║
  3947.      ║ <errorlevel>    a value passed to DOS, which allows batch files    ║
  3948.      ║                   to control their execution with the              ║
  3949.      ║                   IF ERRORLEVEL command                            ║
  3950.      ╚════════════════════════════════════════════════════════════════════╝
  3951.  
  3952.           The command QUIT exits from VP-Info Level 1.  It closes all the
  3953.      files and gives you the prompt of the operating system.
  3954.  
  3955.           If VP-Info Level 1 is running unattended in a batch file, a
  3956.      program can pass an "errorlevel" to DOS indicating if some condition
  3957.      was encountered during execution.  For instance, if there is an error
  3958.      reading a data file, you can QUIT to DOS with an errorlevel of 1,
  3959.      which the batch file can detect so that the tape backup is not run.
  3960.      The command in this case wound be QUIT 1. Consult your DOS reference
  3961.      manual for the IF ERRORLEVEL batch program command.
  3962.  
  3963.           Example:
  3964.  
  3965.      DO CASE
  3966.         CASE ans='0'
  3967.            QUIT
  3968.         CASE ans='2'
  3969.            CHAIN prog1
  3970.         ...
  3971.         OTHERWISE
  3972.            QUIT 1        ;tells DOS an error encountered by VP-Info Level 1
  3973.      ENDCASE
  3974.  
  3975.  
  3976.  
  3977.  
  3978.  
  3979.  
  3980.  
  3981.  
  3982.  
  3983.  
  3984.  
  3985.  
  3986.  
  3987.  
  3988.  
  3989.  
  3990.  
  3991.      QUIT                       VPI1  VPI  VPIN                        QUIT      VP-Info Level 1 Reference Manual          Page 293          SECTION 4
  3992.  
  3993.  
  3994.  
  3995.                                       READ
  3996.  
  3997.      Enter full-screen editing and data entry specified by the @ GET and
  3998.      TEXT commands.
  3999.  
  4000.      ╔════════════════════════════════════════════════════════════════════╗
  4001.      ║ READ                                                               ║
  4002.      ╚════════════════════════════════════════════════════════════════════╝
  4003.  
  4004.           The READ command activates the input aspect of the @ GET commands
  4005.      (including the @ and % macros in a TEXT).  The @ GET command displays
  4006.      the variable at the specified location and format.  The READ command
  4007.      puts the screen in full-screen editing mode with the current values of
  4008.      all fields and memory variables shown, and the new values of all the
  4009.      variables in the @ GET (and the @ and % macros in TEXT) commands can
  4010.      be entered.
  4011.  
  4012.           If the READ changes any key of a record in an index file in use,
  4013.      then the index files are updated.
  4014.  
  4015.           The READ command clears all the pending GET commands.
  4016.  
  4017.           Editing keys:
  4018.  
  4019.      <Left> or Ctrl-S        moves the cursor back one character
  4020.      <Right> or Ctrl-D       moves the cursor forward one character
  4021.      Ctrl-<Left>             moves to the beginning of the field
  4022.      Ctrl-<Right>            moves to the end of the field
  4023.      <Ins> or Ctrl-V         puts you in insert mode: what you type gets
  4024.                                 inserted  (normally, you are in
  4025.                                 overtype mode: what you type overtypes the
  4026.                                 existing text); pressing <Ins> or Ctrl-V
  4027.                                 again, puts you back into overtype mode
  4028.      <BACKSPACE>             deletes the character to the left of the
  4029.                                 cursor
  4030.      <Del> or Ctrl-G         deletes the character on the cursor
  4031.      Ctrl-Y                  deletes the rest of the field
  4032.      Ctrl-Q                  quits and does not update the current record
  4033.      <End> or Ctrl-W         quits and updates the current record
  4034.      Alt-W                   when the cursor is in a memo field, edit the
  4035.                                 current memo (if no current memo, one is
  4036.                                 created) and allow changes to be saved
  4037.      Alt-R                   when the cursor is in a memo field, view the
  4038.                                 current memo in read-only mode; no changes
  4039.                                 are saved
  4040.  
  4041.  
  4042.  
  4043.  
  4044.  
  4045.      READ                       VPI1  VPI  VPIN                        READ
  4046.      VP-Info Level 1 Reference Manual          Page 293a         SECTION 4
  4047.  
  4048.  
  4049.           Example:
  4050.  
  4051.      @ SAY 20,0 'Enter your choice: ' GET ans
  4052.      READ
  4053.  
  4054.      is the same as:
  4055.  
  4056.      ACCEPT 'Enter your choice: ' TO ans
  4057.  
  4058.      except that @ SAY does not create ANS, ACCEPT does; @ SAY directs the
  4059.      query to a specific location on the screen.
  4060.  
  4061.  
  4062.                                   NOTE
  4063.  
  4064.  
  4065.           The editing keys used in the command line and with such input
  4066.      commands as INPUT and ACCEPT use the same set of editing keys as READ,
  4067.      except for those related specifically to full-screen editing. The full
  4068.      set of command-line editing keys is as follows:
  4069.  
  4070.      <Left> or Ctrl-S        moves the cursor back one character
  4071.      <Right> or Ctrl-D       moves the cursor forward one character
  4072.      Ctrl-<Left>             moves to the beginning of the field
  4073.      Ctrl-<Right>            moves to the end of the field
  4074.      <Ins> or Ctrl-V         puts you in insert mode: what you type gets
  4075.                                 inserted  (normally, you are in
  4076.                                 overtype mode: what you type overtypes the
  4077.                                 existing text); pressing <Ins> or Ctrl-V
  4078.                                 again, puts you back into overtype mode
  4079.      <BACKSPACE>             deletes the character to the left of the
  4080.                                 cursor
  4081.      <Del> or Ctrl-G         deletes the character on the cursor
  4082.      Ctrl-Y                  deletes the rest of the field
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.      READ                       VPI1  VPI  VPIN                        READ      VP-Info Level 1 Reference Manual          Page 294          SECTION 4
  4100.  
  4101.  
  4102.  
  4103.                                      RECALL
  4104.  
  4105.      Undelete selected deleted records in the selected file.
  4106.  
  4107.      ╔════════════════════════════════════════════════════════════════════╗
  4108.      ║ RECALL [<scope>] [FOR <cond>]                                      ║
  4109.      ╟────────────────────────────────────────────────────────────────────╢
  4110.      ║ Options:                                                           ║
  4111.      ║                                                                    ║
  4112.      ║ <scope>       select by scope (default scope: current record)      ║
  4113.      ║ FOR <cond>    select by condition                                  ║
  4114.      ╚════════════════════════════════════════════════════════════════════╝
  4115.  
  4116.           Records are flagged as DELETED either with Ctrl-U in BROWSE, or
  4117.      EDIT, or with the DELETE command (see the commands BROWSE, DELETE, and
  4118.      EDIT).  The command RECALL reverses the DELETED flag.
  4119.  
  4120.           The command PACK physically removes all records flagged for
  4121.      deletion.  After a PACK, the records can no longer be recalled.
  4122.  
  4123.           Note that if SET DELETE ON, then RECALL will work only on a
  4124.      deleted record only if it is also the current record.  Normally SET
  4125.      DELETE OFF before using RECALL.
  4126.  
  4127.           Examples:
  4128.  
  4129.      1>USE employee
  4130.      1>GO 2
  4131.      1>DELETE
  4132.            1 DELETE(S)
  4133.      1>LIST name
  4134.            1  Marek
  4135.            2 *Steiner
  4136.            3  Rayme
  4137.            4  Poyner
  4138.            5  Poyner
  4139.            6  Wilson
  4140.      1>GO 2
  4141.      1>RECALL
  4142.            1 RECALL(S)            ;record 2 was recalled
  4143.      1>RECALL                     ;the default is the current record
  4144.            0 RECALL(S)
  4145.      1>DELETE RECORD 2
  4146.            1 DELETE(S)
  4147.      1>DELETE RECORD 4
  4148.            1 DELETE(S)
  4149.      1>DELETE RECORD 6
  4150.            1 DELETE(S)
  4151.      1>RECALL ALL
  4152.            3 RECALL(S)            Note: Records 2, 4, 6 are recalled
  4153.  
  4154.  
  4155.  
  4156.      RECALL                     VPI1  VPI  VPIN                      RECALL      VP-Info Level 1 Reference Manual          Page 295          SECTION 4
  4157.  
  4158.  
  4159.      1>GO TOP
  4160.      1>DELETE
  4161.            1 DELETE(S)
  4162.      1>DELETE RECORD 3
  4163.            1 DELETE(S)
  4164.      1>DELETE RECORD 5
  4165.            1 DELETE(S)
  4166.      1>LIST name
  4167.            1 *Marek
  4168.            2  Steiner
  4169.            3 *Rayme
  4170.            4  Poyner
  4171.            5 *Poyner
  4172.            6  Wilson
  4173.      1>GO TOP
  4174.      1>RECALL NEXT 4
  4175.            2 RECALL(S)            Note: Records 1 and 3 are recalled
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.      RECALL                     VPI1  VPI  VPIN                      RECALL      VP-Info Level 1 Reference Manual          Page 296          SECTION 4
  4214.  
  4215.  
  4216.  
  4217.                                     REINDEX
  4218.  
  4219.      Reindex all index files in use.
  4220.  
  4221.      ╔════════════════════════════════════════════════════════════════════╗
  4222.      ║ REINDEX [FOR <cond>]                                               ║
  4223.      ╟────────────────────────────────────────────────────────────────────╢
  4224.      ║ Option:                                                            ║
  4225.      ║                                                                    ║
  4226.      ║ FOR <cond>    select by condition                                  ║
  4227.      ╚════════════════════════════════════════════════════════════════════╝
  4228.  
  4229.           This command takes all the index files currently in use for the
  4230.      selected data file, and rebuilds each index file.
  4231.  
  4232.           In Conversational VP-Info Level 1, and in programs with SET TALK
  4233.      ON, REINDEX will output the key, the progress of the indexing
  4234.      procedure, showing the completion of each 100 records, and the total
  4235.      number of records indexed.
  4236.  
  4237.           A FOR clause can be used to limit the records in the index(es) to
  4238.      those for which <cond> is true.  See INDEX.
  4239.  
  4240.           On a network with SET NETWORK ON in VP-Info Professional Network
  4241.      Edition, attempting to REINDEX while another user is accessing an
  4242.      index file with the same name as one of the current file's indexes
  4243.      will cause a LOCK error.
  4244.  
  4245.           Examples:
  4246.  
  4247.           The commands:
  4248.  
  4249.      1>USE employee
  4250.      1>INDEX on name+fname TO employee
  4251.  
  4252.      accomplish the same as the following:
  4253.  
  4254.      1>USE employee INDEX employee
  4255.      1>REINDEX
  4256.  
  4257.           Note that for REINDEX, you do not have to specify the key
  4258.      (name+fname) or the name of the index file (EMPLOYEE.NDX).
  4259.  
  4260.           In a program:
  4261.  
  4262.      USE employee INDEX employee,empl1,empl2
  4263.      REINDEX
  4264.  
  4265.      will rebuild three index files: EMPLOYEE.NDX,EMPL1.NDX,EMPL2.NDX.
  4266.  
  4267.  
  4268.  
  4269.  
  4270.      REINDEX                    VPI1  VPI  VPIN                     REINDEX      VP-Info Level 1 Reference Manual          Page 297          SECTION 4
  4271.  
  4272.  
  4273.           The following uses a FOR clause to limit the index to current
  4274.      employee only, based on date of termination being blank:
  4275.  
  4276.      USE employee INDEX employee,empl1,empl2
  4277.      REINDEX FOR terminated=' '
  4278.  
  4279.  
  4280.  
  4281.  
  4282.  
  4283.  
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.  
  4298.  
  4299.  
  4300.  
  4301.  
  4302.  
  4303.  
  4304.  
  4305.  
  4306.  
  4307.  
  4308.  
  4309.  
  4310.  
  4311.  
  4312.  
  4313.  
  4314.  
  4315.  
  4316.  
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325.  
  4326.  
  4327.      REINDEX                    VPI1  VPI  VPIN                     REINDEX      VP-Info Level 1 Reference Manual          Page 298          SECTION 4
  4328.  
  4329.  
  4330.  
  4331.                                     RELEASE
  4332.  
  4333.      Erase memory variables.
  4334.  
  4335.      ╔════════════════════════════════════════════════════════════════════╗
  4336.      ║ RELEASE [<memvar list>/EXCEPT <memvar list>/ALL]                   ║
  4337.      ╟────────────────────────────────────────────────────────────────────╢
  4338.      ║ Options:                                                           ║
  4339.      ║                                                                    ║
  4340.      ║ <memvar list>          the memory variables to be released,        ║
  4341.      ║                           separated by commas                      ║
  4342.      ║ EXCEPT <memvar list>   the memory variables not to be released,    ║
  4343.      ║                           separated by commas                      ║
  4344.      ║ ALL                    release ALL                                 ║
  4345.      ╚════════════════════════════════════════════════════════════════════╝
  4346.  
  4347.           The command RELEASE erases memory variables; it releases memory
  4348.      space for new memory variables.  You can make a list of the memory
  4349.      variables you want removed, use the parameter ALL to remove them all,
  4350.      or use the parameter EXCEPT <memvar list> to remove all except those
  4351.      on the list.
  4352.  
  4353.           This command should be used in programs only with the utmost
  4354.      care.  Compiled programs set pointers to memory variables.  If the
  4355.      memory variables are released, the release must be absolute, not
  4356.      dependent on some conditions.
  4357.  
  4358.           Since 128 memory variables can be used at any one time, and any
  4359.      number of them may be matrix variables, it is best not to RELEASE
  4360.      during a program.  When programs are chained, VP-Info Level 1 will do
  4361.      a CLEAR, which includes a RELEASE ALL.
  4362.  
  4363.           RELEASE does not affect the values of the function keys and the
  4364.      system variables.
  4365.  
  4366.           Examples:
  4367.  
  4368.           1. In Conversational VP-Info Level 1:
  4369.  
  4370.      1>LIST MEMO
  4371.  
  4372.      Name          Type    Width    Contents
  4373.      ** Total **  0  variables, 0  bytes
  4374.      1>name='David'
  4375.      1>age='11'
  4376.      1>LIST MEMO
  4377.  
  4378.      Name          Type    Width    Contents
  4379.      NAME            C       5      David
  4380.      AGE             C       2      11
  4381.  
  4382.  
  4383.  
  4384.      RELEASE                    VPI1  VPI  VPIN                     RELEASE      VP-Info Level 1 Reference Manual          Page 299          SECTION 4
  4385.  
  4386.  
  4387.      ** Total **  2  variables, 7  bytes
  4388.      1>RELEASE age
  4389.      1>LIST MEMO
  4390.  
  4391.      Name          Type    Width    Contents
  4392.      NAME            C       5      David
  4393.      ** Total **  1  variables, 5  bytes
  4394.      1>RELEASE                             ;RELEASE by itself does nothing
  4395.      1>LIST MEMO
  4396.  
  4397.      Name          Type    Width    Contents
  4398.      NAME            C       5      David
  4399.      ** Total **  1  variables, 5  bytes
  4400.      1>age=11
  4401.      1>LIST MEMO
  4402.  
  4403.      Name          Type    Width    Contents
  4404.      NAME            C       5      David
  4405.      AGE             N       8      11
  4406.      ** Total **  2  variables, 13  bytes
  4407.      1>RELEASE ALL
  4408.      1>LIST MEMO
  4409.  
  4410.      Name          Type    Width    Contents
  4411.      ** Total **  0  variables, 0  bytes
  4412.  
  4413.           2. In programming, from a program you might DO a number of
  4414.      subroutines; each uses a number of memory variables, most of which are
  4415.      unique to it, but which in total exceed the 128 memory variable limit.
  4416.      In this case, decide which variables needed to be retained, and use
  4417.      the RELEASE EXCEPT after each subroutine as follows:
  4418.  
  4419.      @ 20,30 SAY ' Enter your choice: ' GET choice PICTURE'!'
  4420.      DO CASE choice                     ;menu choices
  4421.         CASE choice='A'
  4422.            DO proga
  4423.            RELEASE EXCEPT choice,cust,due,amount
  4424.         CASE choice='B'
  4425.            DO progb
  4426.            RELEASE EXCEPT choice,cust,due,amount
  4427.         CASE choice='C'
  4428.            DO progc
  4429.            RELEASE EXCEPT choice,cust,due,amount
  4430.         ENDCASE
  4431.      ENDDO                              ;menu choices
  4432.  
  4433.  
  4434.  
  4435.  
  4436.  
  4437.  
  4438.  
  4439.  
  4440.  
  4441.      RELEASE                    VPI1  VPI  VPIN                     RELEASE      VP-Info Level 1 Reference Manual          Page 300          SECTION 4
  4442.  
  4443.  
  4444.  
  4445.                                      REMARK
  4446.  
  4447.      Display message on screen or printer.
  4448.  
  4449.      ╔════════════════════════════════════════════════════════════════════╗
  4450.      ║ REMARK ['<text line>']                                             ║
  4451.      ╟────────────────────────────────────────────────────────────────────╢
  4452.      ║ Option:                                                            ║
  4453.      ║                                                                    ║
  4454.      ║ '<text line>'       the text line to be displayed                  ║
  4455.      ╚════════════════════════════════════════════════════════════════════╝
  4456.  
  4457.           Same as the command ?.  <text line> may be an expression list.
  4458.  
  4459.  
  4460.  
  4461.  
  4462.  
  4463.  
  4464.  
  4465.  
  4466.  
  4467.  
  4468.  
  4469.  
  4470.  
  4471.  
  4472.  
  4473.  
  4474.  
  4475.  
  4476.  
  4477.  
  4478.  
  4479.  
  4480.  
  4481.  
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.  
  4496.  
  4497.  
  4498.      REMARK                     VPI1  VPI  VPIN                      REMARK      VP-Info Level 1 Reference Manual          Page 301          SECTION 4
  4499.  
  4500.  
  4501.  
  4502.                                      RENAME
  4503.  
  4504.      Rename a file.
  4505.  
  4506.      ╔════════════════════════════════════════════════════════════════════╗
  4507.      ║ RENAME <file> TO <new file>                                        ║
  4508.      ║                                                                    ║
  4509.      ║ <file>        the file name to be changed (default extension DBF)  ║
  4510.      ║ <new file>    the new name for the file   (default extension DBF)  ║
  4511.      ╚════════════════════════════════════════════════════════════════════╝
  4512.  
  4513.           This command is similar to the RENAME command of the operating
  4514.      system: a file is renamed.  No wild card characters are allowed.
  4515.  
  4516.           If the file name has no extension, the extension DBF is assumed.
  4517.      (Do not rename a data or index file to a name starting with the
  4518.      letters COMP; VP-Info Level 1 is unable to open such a file.)
  4519.  
  4520.           Examples:
  4521.  
  4522.      1>RENAME employee TO empl
  4523.  
  4524.      Renames EMPLOYEE.DBF to EMPL.DBF.
  4525.  
  4526.      1>RENAME employee.dbf TO employee.xyz
  4527.  
  4528.  
  4529.  
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536.  
  4537.  
  4538.  
  4539.  
  4540.  
  4541.  
  4542.  
  4543.  
  4544.  
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.      RENAME                     VPI1  VPI  VPIN                      RENAME      VP-Info Level 1 Reference Manual          Page 302          SECTION 4
  4556.  
  4557.  
  4558.  
  4559.                                   RENAME FIELD
  4560.  
  4561.      Rename a field in a data file.
  4562.  
  4563.      ╔════════════════════════════════════════════════════════════════════╗
  4564.      ║ RENAME FIELD <field> TO <new fieldname>                            ║
  4565.      ║                                                                    ║
  4566.      ║ <field>          the field name to be changed                      ║
  4567.      ║ <new fieldname>  the new name for the field                        ║
  4568.      ╚════════════════════════════════════════════════════════════════════╝
  4569.  
  4570.           This command allows you to change the name of a field in a data
  4571.      file without doing a MODIFY, which potentially endangers the file and
  4572.      removes all deleted records, often necessitating a REINDEX.
  4573.  
  4574.           Examples:
  4575.  
  4576.      1>RENAME FIELD employee TO empl
  4577.  
  4578.      Renames the field EMPLOYEE to EMPL in the current data file.
  4579.  
  4580.      1>RENAME#3 FIELD cust TO customer
  4581.  
  4582.                Caution: All programs, report forms and index files that
  4583.           reference the old field name must be revised before they will
  4584.           work properly after a field is renamed.
  4585.  
  4586.  
  4587.  
  4588.  
  4589.  
  4590.  
  4591.  
  4592.  
  4593.  
  4594.  
  4595.  
  4596.  
  4597.  
  4598.  
  4599.  
  4600.  
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.      RENAME FIELD               VPI1  VPI  VPIN                RENAME FIELD      VP-Info Level 1 Reference Manual          Page 303          SECTION 4
  4613.  
  4614.  
  4615.  
  4616.                                      REPEAT
  4617.  
  4618.      Repeat program segment a specified number of times.
  4619.  
  4620.      ╔════════════════════════════════════════════════════════════════════╗
  4621.      ║ REPEAT <num exp> TIMES [VARYING <num var>]                         ║
  4622.      ║                                                                    ║
  4623.      ║ <num exp>    a numeric expression; repeat the loop this many times ║
  4624.      ╟────────────────────────────────────────────────────────────────────╢
  4625.      ║ Option:                                                            ║
  4626.      ║                                                                    ║
  4627.      ║ VARYING <num var>   loop counter                                   ║
  4628.      ╚════════════════════════════════════════════════════════════════════╝
  4629.  
  4630.           The REPEAT command introduces the program structure:
  4631.  
  4632.      REPEAT <num exp> TIMES [VARYING <num var>]
  4633.         <program segment>
  4634.      ENDREPEAT
  4635.  
  4636.           The program lines in the <program segment> are repeated <num exp>
  4637.      times.  The end of the program segment is indicated by ENDREPEAT.
  4638.  
  4639.           The optional VARYING clause is used to vary a memory variable
  4640.      from 1 to <num exp>; at the start of the first loop, <num var> is
  4641.      initialized as 1; <num var> is incremented by 1 each time the top of
  4642.      the loop is reached.
  4643.  
  4644.           This command is especially useful to manipulate matrix variables.
  4645.  
  4646.           Repeats can be nested.
  4647.  
  4648.           The BREAK command is used in a REPEAT loop to exit at the bottom
  4649.      of the loop.  If there are nested loops, the exit is at the bottom of
  4650.      the innermost loop then being executed.
  4651.  
  4652.           The VP-Info Level 1 keywords: TIMES and VARYING should not be in
  4653.      macros.  <num var> cannot be a matrix variable.
  4654.  
  4655.           Note that, if <program segment> contains commands that move the
  4656.      current record pointer (for instance, a SKIP command), REPEAT does not
  4657.      terminate if EOF becomes true.  Thus displaying a record and skipping
  4658.      in a file with 50 records, using REPEAT 100 TIMES, will display the
  4659.      last record in the file 51 times.  DO WHILE .NOT. EOF is the better
  4660.      construction for such a task.
  4661.  
  4662.           When editing with the internal VP-Info Level 1 programming editor
  4663.      (see WRITE command), Alt-F reformats the file with all structures
  4664.      properly indented, making it easy to see unbalanced structures.
  4665.  
  4666.  
  4667.  
  4668.  
  4669.      REPEAT                     VPI1  VPI  VPIN                      REPEAT      VP-Info Level 1 Reference Manual          Page 304          SECTION 4
  4670.  
  4671.  
  4672.           Examples:
  4673.  
  4674.      SET WIDTH TO 40
  4675.      DIM NUM num[10]
  4676.      REPEAT 10 TIMES VARYING count
  4677.         num[count]=POW(2,count)
  4678.      ENDREPEAT
  4679.      ? num
  4680.  
  4681.      This displays:
  4682.  
  4683.  
  4684.            2.00       4.00       8.00
  4685.           16.00      32.00      64.00
  4686.          128.00     256.00     512.00
  4687.         1024.00
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.  
  4695.  
  4696.  
  4697.  
  4698.  
  4699.  
  4700.  
  4701.  
  4702.  
  4703.  
  4704.  
  4705.  
  4706.  
  4707.  
  4708.  
  4709.  
  4710.  
  4711.  
  4712.  
  4713.  
  4714.  
  4715.  
  4716.  
  4717.  
  4718.  
  4719.  
  4720.  
  4721.  
  4722.  
  4723.  
  4724.  
  4725.  
  4726.      REPEAT                     VPI1  VPI  VPIN                      REPEAT      VP-Info Level 1 Reference Manual          Page 305          SECTION 4
  4727.  
  4728.  
  4729.  
  4730.                                     REPLACE
  4731.  
  4732.      Replace field(s) in the selected data file.
  4733.  
  4734.      ╔════════════════════════════════════════════════════════════════════╗
  4735.      ║ REPLACE [<scope>] <field1> WITH <exp1> [,<field2> WITH <exp2> ... ]║
  4736.      ║      [FOR <cond>]                                                  ║
  4737.      ╟────────────────────────────────────────────────────────────────────╢
  4738.      ║ Options:                                                           ║
  4739.      ║                                                                    ║
  4740.      ║ <scope>                 select by scope                            ║
  4741.      ║                            (default scope: current record)         ║
  4742.      ║ <field> WITH <exp>...   list fields and expressions for replacement║
  4743.      ║ FOR <cond>              select by condition                        ║
  4744.      ╚════════════════════════════════════════════════════════════════════╝
  4745.  
  4746.           This command is used for changing some records in the selected
  4747.      data file.  The number of <field> WITH <exp> is only limited by the
  4748.      length of a command line (254 characters).
  4749.  
  4750.           The scope ALL can be used to change all the records in the data
  4751.      file.  This could be dangerous.  Consider backing up your data file
  4752.      before you use this command.
  4753.  
  4754.           This command is very useful, especially in conjunction with SET
  4755.      RELATION TO, so that the fields from which <exp> is formed may come
  4756.      from a number of data files.
  4757.  
  4758.           Examples:
  4759.  
  4760.      1>USE employee
  4761.      1>REPLACE name WITH 'Mareck'
  4762.      1>? name
  4763.      Mareck
  4764.      1>REPLACE ALL salary WITH salary*1.05
  4765.            6 REPLACE(S)
  4766.      1>LIST name,salary
  4767.            1  Mareck           27090.00
  4768.            2  Steiner          37569.00
  4769.            3  Rayme            83065.50
  4770.            4  Poyner            9145.50
  4771.            5  Poyner            9145.50
  4772.            6  Wilson           35563.50
  4773.      1>GO TOP
  4774.      1>REPLACE NEXT 4 salary WITH salary*1.06 FOR name < 'P'
  4775.            1 REPLACE(S)
  4776.      1>USE order
  4777.      1>USE#2 clothing
  4778.      1>SET RELATION ON inven:no TO 2
  4779.      1>REPLACE price WITH price#2
  4780.  
  4781.  
  4782.  
  4783.      REPLACE                    VPI1  VPI  VPIN                     REPLACE      VP-Info Level 1 Reference Manual          Page 306          SECTION 4
  4784.  
  4785.  
  4786.  
  4787.  
  4788.  
  4789.  
  4790.  
  4791.  
  4792.  
  4793.  
  4794.  
  4795.  
  4796.  
  4797.  
  4798.  
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.  
  4824.  
  4825.  
  4826.  
  4827.  
  4828.  
  4829.  
  4830.  
  4831.  
  4832.  
  4833.  
  4834.  
  4835.  
  4836.  
  4837.  
  4838.  
  4839.  
  4840.      REPLACE                    VPI1  VPI  VPIN                     REPLACE      VP-Info Level 1 Reference Manual          Page 307          SECTION 4
  4841.  
  4842.  
  4843.  
  4844.                                      REPORT
  4845.  
  4846.      The report generator.
  4847.  
  4848.      ╔════════════════════════════════════════════════════════════════════╗
  4849.      ║ REPORT [FORM] <form file> [<scope>] [FOR <cond>]                   ║
  4850.      ║                                                                    ║
  4851.      ║ <form file>       the name of the form file                        ║
  4852.      ╟────────────────────────────────────────────────────────────────────╢
  4853.      ║ Options:                                                           ║
  4854.      ║                                                                    ║
  4855.      ║ FOR <cond>         select by condition                             ║
  4856.      ║ <scope>            select by scope (default:ALL)                   ║
  4857.      ╚════════════════════════════════════════════════════════════════════╝
  4858.  
  4859.           The command REPORT is a very versatile report generator.  With a
  4860.      minimum of effort the user can generate a great variety of columnar
  4861.      reports.  The command takes care of the width of the report, the
  4862.      arrangement of the date, page numbering, title(s), the columns, the
  4863.      data in the columns, headings, subtotals (two levels), totals, and
  4864.      many other parameters.
  4865.  
  4866.           This command reports on the file(s) in use according to the
  4867.      format in the report form file <form file>.  The form file can be
  4868.      created  with the VP-Info Level 1 editor (WRITE) or with any word
  4869.      processor; the default extension is FRM.
  4870.  
  4871.           VP-Info Level 1 computes the necessary width as the minimum
  4872.      required to accommodate the title(s), headings, the expression list,
  4873.      and the company name.
  4874.  
  4875.           The report is automatically centered over 80, 112, or 132
  4876.      characters wide, whichever is equal to or greater than the width of
  4877.      the report body.  The SET WIDTH TO command also affects the heading,
  4878.      but not the width of the body.
  4879.  
  4880.           The following keywords can be used in a report form file:
  4881.  
  4882.  
  4883.      COMPRESS                           Sends code 15 to the printer for
  4884.                                           compressed printing on Epson and
  4885.                                           IBM Proprinter printers, sends
  4886.                                           code 18 after completion of the
  4887.                                           report to restore normal-width
  4888.                                           mode. For non-compatible
  4889.                                           printers, use SETUP.)
  4890.  
  4891.      DOUBLE                             Prints double spaced lines.
  4892.  
  4893.      EJECT                              Ejects a page after each subtotal.
  4894.  
  4895.  
  4896.  
  4897.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 308          SECTION 4
  4898.  
  4899.  
  4900.  
  4901.      FIELDS - <exp1>,<exp2>,...         The expressions for the columns of
  4902.                                           the report.
  4903.  
  4904.      FILE - <file> [INDEX <index file>] Opens the data file <file> and,
  4905.                                           optionally, the index file.
  4906.  
  4907.      HEADING - string1,string2,...      The headings for the expressions in
  4908.                                           the report.
  4909.  
  4910.      INDEX - <exp> TO <index file name> [FOR <cond>]
  4911.  
  4912.                                         Indexes on the expression <exp> to
  4913.                                           the specified file the last data
  4914.                                           file opened with the FILE
  4915.                                           keyword; a FOR clause is
  4916.                                           permitted (see INDEX).
  4917.  
  4918.      LENGTH - <num exp>                 Number of printed lines per page.
  4919.  
  4920.      MESSAGE - <str exp>                Introduces the message to be
  4921.                                           displayed for a subtotaled group
  4922.                                           (2 allowed).
  4923.  
  4924.      NODETAIL                           Shows only the totals and
  4925.                                           subtotals.
  4926.  
  4927.      PICTURE - <picture list>           Which expressions (in the FIELDS
  4928.                                           line) are to be totaled.
  4929.  
  4930.      PRINT                              Sends the report to the printer.
  4931.  
  4932.      RELATION - <exp> TO <file number>  Sets a relation between file 1 and
  4933.                                           the file <file number>.
  4934.  
  4935.      SELECT - <cond>                    Selects the records by condition
  4936.                                           <cond>.
  4937.  
  4938.      SETUP - <setup string>             A list of control codes to be sent
  4939.                                           to the printer before beginning
  4940.                                           page 1 (do not use without PRINT
  4941.                                           or SPOOL keywords).
  4942.  
  4943.      SPOOL - <file name>                Sends the report to the file <file
  4944.                                           name> (PRINT must not be used).
  4945.  
  4946.      SUBTOTAL - <exp>                   Subtotals be printed when the
  4947.                                           expression <exp> changes (2
  4948.                                           allowed).
  4949.  
  4950.      TITLE - string or <str exp>        The title of the report (2
  4951.                                           allowed).
  4952.  
  4953.  
  4954.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 309          SECTION 4
  4955.  
  4956.  
  4957.  
  4958.           Some of these keywords can be used more than once.  More detailed
  4959.      explanation follows in the subsection on keywords.
  4960.  
  4961.           The REPORT command is influenced by the commands previously
  4962.      given, such as USE, INDEX, SET PRINT ON.  Most of these can also be
  4963.      done from within the report form file.
  4964.  
  4965.           Commands influencing REPORT.  The REPORT command works on the
  4966.      selected file (if any). So
  4967.  
  4968.      1>SELECT 3
  4969.      3>REPORT salary
  4970.  
  4971.      means: report on file 3 using the report form file SALARY.FRM.  If no
  4972.      file is in use as file 3, the report form file will have to specify
  4973.      (with the FILE keyword) the data file(s) to use.
  4974.  
  4975.           Similarly, specifying the index file(s) to use with the data
  4976.      file(s) and reindexing can be done before the REPORT command is given.
  4977.  
  4978.           Here is a simple example:
  4979.  
  4980.      1>SELECT 2
  4981.      2>USE clients
  4982.      2>INDEX ON newdate TO newdate
  4983.      2>REPORT call
  4984.  
  4985.           The report can be directed to the screen, the printer, or to a
  4986.      text file.  To the printer:
  4987.  
  4988.      2>SET PRINT ON
  4989.  
  4990.      To a text file (TEMP.TXT):
  4991.  
  4992.      2>SPOOL temp
  4993.      2>SET PRINT ON
  4994.      2>REPORT call
  4995.      2>SET PRINT OFF
  4996.      2>SPOOL
  4997.  
  4998.           REPORT can use files related to each other:
  4999.  
  5000.      1>SELECT 1
  5001.      1>USE order INDEX order
  5002.      1>USE#2 client INDEX client
  5003.      1>SET RELATION ON client TO 2
  5004.      1>REPORT order
  5005.  
  5006.           REPORT can use linked files:
  5007.  
  5008.  
  5009.  
  5010.  
  5011.  
  5012.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 310          SECTION 4
  5013.  
  5014.  
  5015.      1>SELECT 1
  5016.      1>USE order index order
  5017.      1>USE#2 history1
  5018.      1>USE#3 history2
  5019.      1>SET LINK TO 2
  5020.      1>SET#2 LINK TO 3
  5021.      1>REPORT order1
  5022.  
  5023.           It may be necessary to send control characters to the printer to
  5024.      set up the desired printing mode.  Example:
  5025.  
  5026.      1>SET PRINT ON
  5027.      1>?? CHR(27)+CHR(121)+CHR(128)
  5028.  
  5029.           The system variables :COMPANY, :TITLE, and :DATE influence the
  5030.      report.  The company name in :COMPANY appears centered in the second
  5031.      line of the report.  The text in :TITLE becomes the title of the
  5032.      report unless the report form file specifies otherwise (with the
  5033.      keyword TITLE).  The date on the first line of the report comes from
  5034.      :DATE.
  5035.  
  5036.           The three system variables may be changed before REPORT.
  5037.  
  5038.           Much of what can be accomplished by setting the environment of
  5039.      REPORT before the command is given, can also be done in the report
  5040.      format file.  There are some exceptions: for instance, since SPOOL
  5041.      adds to the top of an existing file with the same name as the spool
  5042.      file, you may want to delete the existing file before doing the
  5043.      report, or alternately using the SPOOL command outside the report and
  5044.      the keyword PRINT inside the report.  You may also want to set page
  5045.      depth with SET LENGTH TO, the number of character over which the
  5046.      heading will be centered with SET WIDTH TO, the left margin with SET
  5047.      MARGIN TO, etc.  See also SET EJECT.
  5048.  
  5049.           The form of the REPORT command.  The selection criteria can be
  5050.      placed in the REPORT command and/or in the report form file.  If the
  5051.      REPORT command contains a FOR clause, and the report form file has a
  5052.      SELECT line, then the FOR clause of the REPORT command overrules the
  5053.      SELECT line of the report form file.
  5054.  
  5055.           You may restrict the range of records in the report by the LIMIT
  5056.      command or a scope; both must be invoked outside the REPORT form.  The
  5057.      WHILE <cond> form of the scope may be very useful when reporting on a
  5058.      very big file. As an example,
  5059.  
  5060.      1>USE orders INDEX clients
  5061.  
  5062.      In the current record the field CLIENT contains A234.  To report on
  5063.      all the orders by this client with part number > 1200:
  5064.  
  5065.      1>REPORT ship WHILE client='A234' FOR VAL(part:num)>1200
  5066.  
  5067.  
  5068.  
  5069.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 311          SECTION 4
  5070.  
  5071.  
  5072.  
  5073.      or
  5074.  
  5075.      1>LIMIT client
  5076.      1>REPORT ship FOR VAL(part:num)>1200
  5077.      1>LIMIT
  5078.  
  5079.      Note that without either the scope or the LIMIT command, processing
  5080.      would stop only after all the records of the file had been processed.
  5081.  
  5082.           Report form file.  Look at the examples of report form files
  5083.      given below.  In a report form file, the first word of a line has to
  5084.      be a keyword, followed by any modifiers separated from the keyword by
  5085.      a hyphen (-).  There are currently 18 keywords.
  5086.  
  5087.           Only the FIELDS line is required; all the others are optional.
  5088.      Some keywords can occur more than once.
  5089.  
  5090.  
  5091.           Keywords:
  5092.  
  5093.  
  5094.      TITLE - string/<str exp>
  5095.  
  5096.           This keyword is followed by the title of the report; the title
  5097.      appears centered as the third line of the report.  If no title is
  5098.      specified in the text file, then the string in the system variable
  5099.      :TITLE (if any) is used for the title.
  5100.  
  5101.           If a <str exp> is used, it will be evaluated, and used as the
  5102.      title.  If an invalid expression is used, it will be printed as a
  5103.      literal.
  5104.  
  5105.           VP-Info Level 1 looks at the TITLE line; what appears to the
  5106.      right of the hyphen is evaluated as an expression.  If it is valid,
  5107.      then it is used as an expression.  If it is not, then it is printed
  5108.      "as is."
  5109.  
  5110.           So to get Annual Report as the title, simply use the line
  5111.  
  5112.      TITLE - Annual Report
  5113.  
  5114.      No quotation marks are needed.
  5115.  
  5116.           The TITLE keyword may be used twice:
  5117.  
  5118.      TITLE - string1
  5119.      TITLE - string2
  5120.  
  5121.      Then the title is in two lines, both centered.
  5122.  
  5123.  
  5124.  
  5125.  
  5126.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 312          SECTION 4
  5127.  
  5128.  
  5129.           If ASOF is a variable containing the date of the last accounts-
  5130.      receivable aging in the standard format, then
  5131.  
  5132.      TITLE - 'Accounts receivable as of '+DATE(FULL,asof)
  5133.  
  5134.      will display
  5135.  
  5136.              Accounts receivable as of Thursday, September 19, 1991
  5137.  
  5138.      FILE - <data file> [INDEX <index file>]
  5139.  
  5140.           This keyword opens the data file (as file 1, if there was a file
  5141.      open as file 1, it is first closed) and, optionally, the index file.
  5142.  
  5143.           This keyword may occur a number of times.  The second time it
  5144.      opens file 2, then file 3, and so on.  Since the reporting is done on
  5145.      the first data file opened by FILE, more than one file should be
  5146.      opened only if relations are used.
  5147.  
  5148.           If there is no FILE line, REPORT uses the current data file.  If
  5149.      none is open, an error message (usually: 2. Variable not found.) is
  5150.      given.
  5151.  
  5152.  
  5153.      INDEX - <exp> TO <index file name> [FOR <cond>]
  5154.  
  5155.           This keyword will index the last data file opened with the FILE
  5156.      keyword on the expression <exp> to the specified index file.  If this
  5157.      is only a temporary index, then you should specify a name such as
  5158.      TEMP.  A condition can be specified to limit the index to only those
  5159.      records matching the condition; this is often faster than using SELECT
  5160.      or a FOR clause on the REPORT command.
  5161.  
  5162.  
  5163.           Example:
  5164.  
  5165.      FILE - inventry
  5166.      INDEX - inven:no TO temp1 FOR type='G'
  5167.      FILE - supplier
  5168.      INDEX - suppl:code TO temp2
  5169.  
  5170.  
  5171.      opens up the data files: INVENTRY as file 1 and SUPPLIER as file 2,
  5172.      and indexes both, limiting the primary index and the report to those
  5173.      for which type='G'.
  5174.  
  5175.  
  5176.      FIELDS - <exp1>,<exp2>,...
  5177.  
  5178.           This is the expression list; these expressions fill the columns
  5179.      of the report.  Often, these expressions are just field names, though
  5180.      they may be arbitrary expression including fields (from various data
  5181.      files), variables, and constants.
  5182.  
  5183.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 313          SECTION 4
  5184.  
  5185.  
  5186.  
  5187.           If all the expressions do not fit on one line, then leave a comma
  5188.      at the end of the line and continue on the next line.
  5189.  
  5190.  
  5191.      HEADING - string1,string2,...
  5192.  
  5193.           These are the column headings for each expression in FIELDS line.
  5194.      Separate the strings with commas.  The spacing of each column is done
  5195.      by the program based on the largest of the following: the length of
  5196.      the heading, the width of the field, and the picture clause in the
  5197.      PICTURE line.  Blanks on the left and on the right of a heading are
  5198.      counted in the width.
  5199.  
  5200.           To move a column to the right, put spaces in front of the column
  5201.      heading.  To make a column wider, put spaces at the end of the column
  5202.      heading.  To move the column heading of a numeric field to the left,
  5203.      put spaces at the end of the column heading.
  5204.  
  5205.           If no heading is required for a column, it may be omitted, but
  5206.      its comma is required if any later columns are to have a heading; no
  5207.      trailing commas are permitted, since they would be understood as
  5208.      continuation characters merging the next keyword to the HEADING line..
  5209.  
  5210.           If the strings in the HEADING line do not fit on one line, then
  5211.      leave a comma at the end of the line and continue on the next line.
  5212.      Do not break a heading with a comma.
  5213.  
  5214.  
  5215.           Multi-line headings.  In the HEADING line, a semicolon (;) breaks
  5216.      the heading into more than one line.  At most three lines are
  5217.      permitted.
  5218.  
  5219.           For instance,
  5220.  
  5221.      HEADING - Last Name;=========,First Name;==========,
  5222.      Department;==========,Salary;======
  5223.  
  5224.  
  5225.      produces the headings:
  5226.  
  5227.      Last Name       First Name Department         Salary
  5228.      =========       ========== ==========         ======
  5229.  
  5230.  
  5231.           Note the use of the comma (,) at the end of the first line as a
  5232.      continuation character.
  5233.  
  5234.  
  5235.  
  5236.  
  5237.  
  5238.  
  5239.  
  5240.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 314          SECTION 4
  5241.  
  5242.  
  5243.  
  5244.      PICTURE - <format list>
  5245.  
  5246.           The PICTURE keyword is used to indicate which expressions (in the
  5247.      FIELDS line) are to be totaled.  The PICTURE line also shows how the
  5248.      expressions and totals (and subtotals) are to be displayed.
  5249.  
  5250.           A format is some 9s and, optionally, a decimal point or other
  5251.      special characters used in the format clause for numbers (see the
  5252.      command @).  Examples:
  5253.  
  5254.      999
  5255.      999999.99
  5256.      9.9999
  5257.      999999.99-
  5258.      999999.99>
  5259.  
  5260.  
  5261.           A format list is a number of formats separated by commas.  Some
  5262.      formats may be missing, but the commas have to be there as long as
  5263.      formats are required to reach the last field requiring accumulation.
  5264.      no trailing commas are permitted, since they would be understood as
  5265.      continuation characters merging the next keyword to the picture line.
  5266.  
  5267.           Negative values can be displayed in any of three ways.  The
  5268.      default is to use a leading minus sign.  It is possible to surround
  5269.      negative values with pointed brackets, or to use trailing minus signs
  5270.      as follows:
  5271.  
  5272.           Indicator for Negatives    Example       Value        Displays
  5273.  
  5274.           None                       9999999.99    -19876.87     -19876.87
  5275.           Trailing minus sign        9999999.99-   -19876.87      19876.87-
  5276.           None                       9999999.99>   -19876.87     <19876.87>
  5277.  
  5278.           If a format includes a comma, that format must be enclosed in
  5279.      quotes.
  5280.  
  5281.           The following will all total the fourth and the fifth columns out
  5282.      of the eight (or more) specified in the FIELDS line:
  5283.  
  5284.      PICTURE - ,,,999.99,999999
  5285.      PICTURE - ,,,999.99,'999,999'
  5286.      PICTURE - ,,,999.99,'$$$,$$9.99'
  5287.      PICTURE - ,,,999.99-,'999,999-'
  5288.      PICTURE - ,,,999.99>,'$$$,$$9.99>'
  5289.  
  5290.           There can be no format for character fields in the PICTURE line,
  5291.      since no strings are carried from record lines to total lines.  To
  5292.      format a character field, use PIC( or other functions.
  5293.  
  5294.  
  5295.  
  5296.  
  5297.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 315          SECTION 4
  5298.  
  5299.  
  5300.  
  5301.      SUBTOTAL - <exp>
  5302.  
  5303.           This keyword causes subtotals to be printed when the expression
  5304.      <exp> changes.  Subtotaling is done for all numeric expressions that
  5305.      are specified in the PICTURE line.
  5306.  
  5307.           Of course, subtotaling produces erratic result if the data file
  5308.      is not sorted or indexed in a way to group all the items with the same
  5309.      <exp> in one group.  The command REPORT works whether or not this is
  5310.      the case.
  5311.  
  5312.  
  5313.      MESSAGE - <str exp>
  5314.  
  5315.           This keyword introduces the message to be displayed on the report
  5316.      lines at the start of a subtotaled group; e.g., 'Salesman - '+salesm.
  5317.  
  5318.  
  5319.           Two levels of subtotaling.  If there are two SUBTOTAL lines:
  5320.  
  5321.      SUBTOTAL - <exp1>              "inside level"
  5322.      MESSAGE - string1              message for the "inside level", footer
  5323.      SUBTOTAL - <exp2>              "outside level"
  5324.      MESSAGE - string2              message for the "outside level", header
  5325.  
  5326.      two levels of subtotaling is done.  <exp1> is the "inside" level (the
  5327.      sub-subtotal) and <exp2> is the "outside" level (the grand subtotal).
  5328.  
  5329.           The message for the outside level appears as a header; the
  5330.      message of the inside level appears with the sub-subtotal.  String1 is
  5331.      printed from the start of the line.  Make sure that there is enough
  5332.      room for string1 before the start of the first totaled column.
  5333.  
  5334.           For instance, if the file is indexed on salesman+style, then
  5335.      salesman is exp2, the outside level, and salesman+style is exp1, the
  5336.      inside level.  Thus one obtains a sales report grouped by salesman
  5337.      (outside level), and within salesman by style (inside level):
  5338.  
  5339.      SUBTOTAL - salesman+style
  5340.      MESSAGE - 'Style '+style
  5341.      SUBTOTAL - salesman
  5342.      MESSAGE - 'Salesman '+salesman
  5343.  
  5344.           Note that the inside subtotal expression in on salesman+style
  5345.      instead of by style alone; this is done because the last record for
  5346.      one salesman might be the same as the first record for the next
  5347.      salesman, thus giving confusing results.  Both subtotal expressions
  5348.      should be some leftmost part of the index expression, with the inside
  5349.      expression longer than the outside expression.
  5350.  
  5351.  
  5352.  
  5353.  
  5354.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 316          SECTION 4
  5355.  
  5356.  
  5357.  
  5358.      PRINT
  5359.  
  5360.           This will send the report to the printer.  It has the same effect
  5361.      as SET PRINT ON at the beginning of the report and SET PRINT OFF at
  5362.      the end.
  5363.  
  5364.  
  5365.      EJECT
  5366.  
  5367.           This keyword will cause a page eject after each subtotal.  If two
  5368.      levels of subtotals are specified, only the main level will cause a
  5369.      page eject.
  5370.  
  5371.           If SET EJECT OFF, instead of sending a form feed code to the
  5372.      printer, VP-Info Level 1 will send enough carriage returns to move the
  5373.      paper in the printer to the form depth set by the SET LENGTH TO
  5374.      command (default is 66).
  5375.  
  5376.  
  5377.      RELATION - <str exp> TO <file number>
  5378.  
  5379.           This keyword sets a relation between file 1 and the file <file
  5380.      number>.  It is equivalent to the commands:
  5381.  
  5382.  
  5383.      1>SELECT 1
  5384.      1>SET RELATION ON <str exp> TO <file number>
  5385.  
  5386.           Example:
  5387.  
  5388.      RELATION - inven:no TO 2.
  5389.  
  5390.  
  5391.           There can be a number of these lines.  File 1 can be in relations
  5392.      to file 2, file 3, and so on.  The relations are always between file 1
  5393.      and another file.
  5394.  
  5395.  
  5396.      DOUBLE
  5397.  
  5398.           Print double spaced lines.
  5399.  
  5400.  
  5401.      COMPRESS
  5402.  
  5403.           Sends code 15 to the printer for compressed printing; and code 18
  5404.      after the report to discontinue compressed printing.  If the printer
  5405.      requires different codes, use the SETUP keyword or send them before
  5406.      and after the REPORT command with the function CHR(.
  5407.  
  5408.  
  5409.  
  5410.  
  5411.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 317          SECTION 4
  5412.  
  5413.  
  5414.  
  5415.      SETUP - <setup string>
  5416.  
  5417.           SETUP establishes a string of control characters to be sent to
  5418.      the printer when printing begins.  It should not be used if neither
  5419.      printing nor spooling is in effect.
  5420.  
  5421.           The setup string is a list of character descriptors, separated by
  5422.      commas. Each descriptor may be a number (the ASCII value of a
  5423.      character), a hex number followed by an "h" (the hex value of a
  5424.      character, or any alpha character.  Example
  5425.  
  5426.      SETUP - 27,W,1Bh,41h,3h
  5427.  
  5428.  
  5429.      SPOOL - <file name>
  5430.  
  5431.           This is an alternative to the PRINT keyword and SET PRINT ON, and
  5432.      should not appear if either of the others is present.  It sends the
  5433.      report to the file <file name> (default extension TXT).
  5434.  
  5435.           Spool a report if you want to pretty it up with your word
  5436.      processor, or include it in a document, or print it some other time.
  5437.      The VP-Info Level 1 command SPOOL finename TO PRN or the operating
  5438.      system command PRINT can later print the report in the background mode
  5439.      from this file.
  5440.  
  5441.           Note that if <file name> already exists, the report will be added
  5442.      at its end; it will not be overwritten.  (Do not confuse the SPOOL
  5443.      keyword with the SPOOL command, which does overwrite existing files.)
  5444.  
  5445.  
  5446.      SELECT - <cond>
  5447.  
  5448.           Select by condition <cond>; the same as a FOR clause in the
  5449.      REPORT command.  If a FOR clause is used in the REPORT command, it
  5450.      overrides the selection of the SELECT line.  If a FILTER is in effect,
  5451.      only records which match both the filter and the select condition are
  5452.      included in the report.
  5453.  
  5454.  
  5455.      NODETAIL
  5456.  
  5457.           This modifies a report with subtotaling: only the totals and
  5458.      subtotals are shown.  The expressions from the FIELDS line and the
  5459.      column headings from the HEADING line are not displayed.
  5460.  
  5461.  
  5462.      LENGTH - <num exp>
  5463.  
  5464.           This sets the number of printed lines per page.  For instance,
  5465.  
  5466.  
  5467.  
  5468.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 318          SECTION 4
  5469.  
  5470.  
  5471.  
  5472.      LENGTH - 40
  5473.  
  5474.      will set the page length at 40.
  5475.  
  5476.           Comments.  The lines in the report form file can be separated by
  5477.      any number of blank lines to increase readability.
  5478.  
  5479.           A * can be put at the front a line to comment out (temporarily)
  5480.      that line.
  5481.  
  5482.           The lines can appear in just about any order.  The INDEX keyword
  5483.      must appear after the FILE keyword, and the MESSAGE keyword must
  5484.      appear after the SUBTOTAL keyword.
  5485.  
  5486.           Examples of report form files:
  5487.  
  5488.           Example 1. The simplest report form file, SALARY.FRM:
  5489.  
  5490.      FIELDS - name,fname,dept,salary
  5491.  
  5492.  
  5493.           Use it with the commands:
  5494.  
  5495.      1>USE employee INDEX name
  5496.      1>REPORT salary
  5497.  
  5498.           Example 2.  Using a multi-line heading (use it with the same
  5499.      commands as those for Example 1):
  5500.  
  5501.      HEADING - Last Name;=========,First Name;==========,
  5502.      Department;==========,Salary;======
  5503.      FIELDS - name,fname,dept,salary
  5504.  
  5505.           Example 3. Using two title lines (use it with the same commands
  5506.      as those for Example 1):
  5507.  
  5508.      TITLE - Salary Report
  5509.      TITLE - For the Third Quarter
  5510.      HEADING - Last Name,First Name,Department,Salary
  5511.      FIELDS - name,fname,dept,salary
  5512.  
  5513.           Example 4. A simple totaling using a string expression for the
  5514.      title; the memory variable QUARTER contains 'First', 'Second, 'Third',
  5515.      or 'Fourth' (use it with the same commands as those for Example 1):
  5516.  
  5517.      TITLE - Salary Report
  5518.      TITLE - 'For the '+quarter+' Quarter'
  5519.      HEADING - Last name,First name  ,Department,Salary
  5520.      FIELDS - name,fname,dept,salary
  5521.      PICTURE - ,,,9999999.99
  5522.  
  5523.  
  5524.  
  5525.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 319          SECTION 4
  5526.  
  5527.  
  5528.  
  5529.           Example 5. Subtotaling by department:
  5530.  
  5531.      TITLE - Salary Report
  5532.      HEADING - Last name,First name  ,Department,Salary
  5533.      FIELDS - name,fname,dept,salary
  5534.      SUBTOTAL - dept
  5535.      PICTURE - ,,,9999999.99
  5536.  
  5537.      Use it with the commands:
  5538.  
  5539.      1>USE employee
  5540.      1>INDEX ON dept TO dept
  5541.      1>REPORT salary
  5542.  
  5543.           Example 6. Subtotal with a message, appearing as a header for the
  5544.      group (use it with the same commands as those for Example 5):
  5545.  
  5546.      TITLE - Salary Report
  5547.      HEADING - Last name,First name  ,Salary
  5548.      FIELDS - name,fname,salary
  5549.      MESSAGE - 'Department: '+dept
  5550.      SUBTOTAL - dept
  5551.      PICTURE - ,,9999999.99
  5552.  
  5553.           Example 7. Two levels of subtotaling (use it with the same
  5554.      commands as those for Example 5):
  5555.  
  5556.      HEADING -  ,          ,Part,Date,Amount
  5557.      FIELDS - ' ',' ',part,date,amount
  5558.      PICTURE - ,,,,999999.99
  5559.      SUBTOTAL - salesman+part
  5560.      MESSAGE - 'Part '+trim(part)+' total: '
  5561.      SUBTOTAL - salesman
  5562.      MESSAGE - 'Salesman: '+salesman
  5563.  
  5564.           Example 8. Specifying files in use and a relation:
  5565.  
  5566.      FILE - sales INDEX sales
  5567.      FILE - abbrev INDEX abbrev
  5568.      RELATION - part TO 2
  5569.      HEADING -  ,               ,Part,Date,Amount
  5570.      FIELDS - ' ',' ',part,date,amount
  5571.      PICTURE - ,,,,999999.99
  5572.      SUBTOTAL - salesman+part
  5573.      MESSAGE - TRIM(descr#2)+' total: '
  5574.      SUBTOTAL - salesman
  5575.      MESSAGE - 'Salesman: '+salesman
  5576.  
  5577.  
  5578.  
  5579.  
  5580.  
  5581.  
  5582.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 320          SECTION 4
  5583.  
  5584.  
  5585.           Example 9.  A real-life example:
  5586.  
  5587.      TITLE - 'Report on '+trim(product)+' sales'
  5588.      TITLE - 'For month ending '+date(lchar,date(ymd))
  5589.      FILE - inven INDEX inven2
  5590.      INDEX - style TO inven2 FOR q1+q2+q3+q4+q5+q6+q7+q8>0
  5591.      HEADING - COLOR,DESCRIPTION,,ONE,XXS,XS,S,M,L,XL,QUANT
  5592.      FIELDS - color,descript,
  5593.      q1,q2,q3,q4,q5,q6,q7,q8,
  5594.      q1+q2+q3+q4+q5+q6+q7+q8
  5595.      SUBTOTAL - style
  5596.      MESSAGE - 'Style - '+style
  5597.      PICTURE - ,,9999,9999,9999,9999,9999,9999,9999,9999,99999
  5598.      EJECT
  5599.      PRINT
  5600.  
  5601.  
  5602.  
  5603.  
  5604.  
  5605.  
  5606.  
  5607.  
  5608.  
  5609.  
  5610.  
  5611.  
  5612.  
  5613.  
  5614.  
  5615.  
  5616.  
  5617.  
  5618.  
  5619.  
  5620.  
  5621.  
  5622.  
  5623.  
  5624.  
  5625.  
  5626.  
  5627.  
  5628.  
  5629.  
  5630.  
  5631.  
  5632.  
  5633.  
  5634.  
  5635.  
  5636.  
  5637.  
  5638.  
  5639.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 321          SECTION 4
  5640.  
  5641.  
  5642.           Example 10. An example with expressions:
  5643.  
  5644.      TITLE - Inventory Listing
  5645.      *
  5646.      FILE - inven
  5647.      INDEX - style+color TO inven1
  5648.      *
  5649.      HEADING - STYLE,COLOR,DESCRIPTION,COST,
  5650.      ,ONE,XXS,XS,S,M,L,XL,
  5651.      QUANT,ORDER,PROG,AVAIL,OYTD,CYTD,SYTD
  5652.      *
  5653.      FIELDS - style,color,descript,cost,
  5654.      q1,q2,q3,q4,q5,q6,q7,q8,
  5655.      quant,order,progress,quant-order+progress,oytd,cytd,sytd
  5656.      *
  5657.      PICTURE - ,,,,9999,9999,9999,9999,9999,9999,9999,9999,99999,99999,
  5658.      99999,99999,99999,99999,99999
  5659.      *
  5660.      PRINT
  5661.      *
  5662.      SUBTOTAL - style
  5663.      MESSAGE - 'Style - '+style
  5664.  
  5665.  
  5666.                             A General Discussion on
  5667.                                Multi-File Reports
  5668.                         Using Relations and Subtotaling
  5669.  
  5670.           Since many database users come to VP-Info Level 1 with some
  5671.      exposure to other database languages which cannot print reports using
  5672.      relations, this powerful tool is often overlooked by many users and
  5673.      even magazine reviewers.
  5674.  
  5675.           VP-Info Level 1 allows any two data files to be linked together,
  5676.      either in a chain (1-to-2, 2-to-3, 3-to-4, etc.) or multiple-child
  5677.      relationship (1-to-2, 1-to-3, 1-to-4, etc., simultaneously).
  5678.  
  5679.           Let's say you want to print a list of all items sold today from
  5680.      your store.  Each item is described in ITEMS.DBF, customers are stored
  5681.      in CUST.DBF, and invoices list all items in a file called INVOICE.DBF.
  5682.  
  5683.           You can get the report you want, using the report specification
  5684.      in Figure 1, with the following command, either in a program or at the
  5685.      command prompt:
  5686.  
  5687.      REPORT invcdate FOR date=date(1)
  5688.  
  5689.      ──────────────────────────────────────────────────────────────────────
  5690.                                                             Figure 1
  5691.      * INVCDATE.FRM  report form for printing invoice details by date
  5692.      FILE - invoice INDEX invcdate
  5693.  
  5694.  
  5695.  
  5696.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 322          SECTION 4
  5697.  
  5698.  
  5699.      FILE - items INDEX itemcode
  5700.      FILE - cust INDEX custcode
  5701.      RELATION - itemcode TO 2
  5702.      RELATION - custcode TO 3
  5703.      FIELDS - date,custcode,name#3,itemcode#2,quant,price,price*quant
  5704.      HEADING - DATE,CUSTOMER,NAME,ITEM,QUANTITY,PRICE,TOTAL
  5705.      PICTURE - ,,,,,,$$$$$$9.99
  5706.      PRINT
  5707.      TITLE - 'Invoices Produced '+date(char)
  5708.  
  5709.      ──────────────────────────────────────────────────────────────────────
  5710.  
  5711.           This produces the report shown in Figure 2.
  5712.  
  5713.  
  5714.      SUBTOTALING
  5715.  
  5716.           Of course, the report could have been printed in order by
  5717.      customer or item code just as easily, and even grouped and subtotalled
  5718.      by either of them.  For example, adding these two lines after the
  5719.      PICTURE line,
  5720.  
  5721.      SUBTOTAL - custcode
  5722.      MESSAGE - name#3
  5723.  
  5724.      would print the name of the customer above all items he purchased, and
  5725.      show a total cost of all these items for each customer, as well as a
  5726.      grand total of all customers.
  5727.  
  5728.           VP-Info Level 1 actually provides two levels of grouping and
  5729.      subtotaling, which we call the "inside" level and the "outside" level.
  5730.  
  5731.           Let's say our file in indexed on CUSTCODE+DATE to INVCCUST.NDX.
  5732.      Then we produce the report shown in Figure 3 by inserting the
  5733.      following four lines into our report specification after the PICTURE
  5734.      line:
  5735.  
  5736.      SUBTOTAL - custcode+date
  5737.      MESSAGE - blank(5)+date(dmy,date)
  5738.      SUBTOTAL - custcode
  5739.      MESSAGE - name#3
  5740.  
  5741.           The first two lines specify the inside level, while the last two
  5742.      set up the outside level.  You'll notice that there can be several
  5743.      days grouped inside a single customer; that's why date is the INSIDE
  5744.      grouping.
  5745.  
  5746.           Also notice that the "trigger expression" for the inside level is
  5747.      CUSTCODE+DATE and not DATE alone.  Remember that you want a date
  5748.      heading and subtotal printed whenever a customer changes, even if the
  5749.      next customer's purchase was on the same day.  The best rule is to
  5750.  
  5751.  
  5752.  
  5753.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 323          SECTION 4
  5754.  
  5755.  
  5756.      make sure that the trigger expression for the inside grouping is
  5757.      longer than, and includes all of, the outside trigger expression.
  5758.  
  5759.           (In actual practice, you would probably adjust the specification
  5760.      to remove the date and name#3 fields from the FIELDS line, since they
  5761.      are printed in the header and footer of the groups.)
  5762.  
  5763.  
  5764.      A FEW REPORT TIPS:
  5765.  
  5766.           Although the single command, REPORT invcdate FOR date=DATE(ymd),
  5767.      can produce the report shown above, there are a couple of better and
  5768.      faster -- but more complicated -- ways to get the same result.  The
  5769.      problem is that, over time, the invoice file will become very large,
  5770.      and the method shown above requires every single record to be
  5771.      processed, even though only a few are going to be printed.
  5772.  
  5773.           Better Method 1 is primarily for those who want to use the report
  5774.      from the command prompt.  Use these three lines instead,
  5775.  
  5776.      USE invoice
  5777.      INDEX ON item TO temp FOR date=date(ymd)
  5778.      REPORT invcdate
  5779.  
  5780.      thus making a special index which includes only the records you want
  5781.      to print.  Even with very large files, this is extremely quick.  Of
  5782.      course, you'll have to change the first line of your report file to
  5783.      read "FILE - invoice INDEX temp".
  5784.  
  5785.           Better Method 2 will be chosen by most programmers who can easily
  5786.      set up the files and relations to be used for the report in their
  5787.      program as follows:
  5788.  
  5789.      SELECT 1
  5790.      USE invoice INDEX invcdate
  5791.      USE#2 items INDEX itemcode
  5792.      USE#3 cust INDEX custcode
  5793.      SET RELATION ON itemcode TO 2
  5794.      SET RELATION ON custcode TO 3
  5795.      FIND &date(ymd)
  5796.      REPORT INVCDATE WHILE date=date(ymd)
  5797.  
  5798.           Of course, the FILE and RELATION lines would be omitted from
  5799.      INVCDATE.FRM.
  5800.  
  5801.  
  5802.      USING RELATION TO SHOW WHAT ISN'T THERE
  5803.  
  5804.           Relations aren't used just to show what is in another file.  In
  5805.      fact, one of these best uses is to highlight things that aren't there.
  5806.  
  5807.  
  5808.  
  5809.  
  5810.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 324          SECTION 4
  5811.  
  5812.  
  5813.           Remember that setting up a relation means that, every time the
  5814.      record number changes on the main file, a FIND is executed on the
  5815.      relation expression to the related file.  If no matching record is
  5816.      found, the related file is set to the mythical record zero, meaning
  5817.      that all character fields are blank and all numeric fields are zero.
  5818.  
  5819.           Say you have a data file with a customer code field, but you
  5820.      aren't sure that every code is correct.  You can set up a relation
  5821.      between the two files and print the report specified in Figure 4,
  5822.      showing all records for which NO customer was found in CUST.DBF.  It's
  5823.      the line "SELECT - custcode<>'   '" that causes only mismatched
  5824.      records to print.
  5825.  
  5826.           With all the power built into the VP-Info Level 1 REPORT command
  5827.      -- relations and two levels of grouping -- it's rare even for full-
  5828.      time custom programmers to take the time to write a program to produce
  5829.      a report.  Once you get a little practice, you'll find that only a few
  5830.      minutes are needed to create complex and exciting reports.
  5831.  
  5832.  
  5833. ──────────────────────────────────────────────────────────────────────
  5834.                                                        Figure 2
  5835. Monday, February 13, 1991                                        Page 1
  5836.                   COMPUTER DISTRIBUTING EXTRORDINAIRE
  5837.                   Invoices Produced February 13, 1991
  5838.  
  5839. DATE   CUSTOMER NAME                 ITEM  QUANTITY    PRICE      TOTAL
  5840.  
  5841. 910213 SUB50    Sub Rosa Inc.        VPINF       10   199.00   $1990.00
  5842. 910213 CRE50    Create Computer      VPEXP        2   179.00    $358.00
  5843. 910213 PSI50    Paperback Software   VPPLA        1   149.00    $149.00
  5844. 910213 SUB50    Sub Rosa Inc.        VPPLU        2   249.00    $498.00
  5845. 910213 CRE50    Create Computer      VPINF       12   199.00   $2388.00
  5846. 910213 PSI50    Paperback Software   VPEXP       54   179.00   $9666.00
  5847. 910213 SUB50    Sub Rosa Inc.        VPPLA        1   149.00    $149.00
  5848. 910213 CRE50    Create Computer      VPPLU        5   249.00   $1245.00
  5849. 910213 PSI50    Paperback Software   VPINF        1   199.00    $199.00
  5850. 910213 CRE50    Create Computer      VPEXP       21   179.00   $3759.00
  5851. 910213 PSI50    Paperback Software   VPPLA      285   149.00  $42465.00
  5852. 910213 SUB50    Sub Rosa Inc.        VPPLU       85   249.00  $21165.00
  5853.                                                              ==========
  5854.                                                               $84031.00
  5855.  
  5856. ──────────────────────────────────────────────────────────────────────
  5857.  
  5858.  
  5859. ──────────────────────────────────────────────────────────────────────
  5860.                                                        Figure 3
  5861. Monday, February 13, 1991                                       Page 3
  5862.                   COMPUTER DISTRIBUTING EXTRAORDINAIRE
  5863.                   Invoices Produced February 13, 1991
  5864.  
  5865.  
  5866.  
  5867.      REPORT                     VPI1  VPI  VPIN                      REPORT      VP-Info Level 1 Reference Manual          Page 325          SECTION 4
  5868.  
  5869.  
  5870.  
  5871. DATE   CUSTOMER NAME                 ITEM  UANTITY    PRICE      TOTAL
  5872. Create Computer
  5873. 910213 CRE50    Create Computer      VPEXP       2   179.00    $358.00
  5874. 910213 CRE50    Create Computer      VPINF      12   199.00   $2388.00
  5875. 910213 CRE50    Create Computer      VPPLU       5   249.00   $1245.00
  5876. 910213 CRE50    Create Computer      VPEXP      21   179.00   $3759.00
  5877.      13-Feb-1991                                              $7750.00
  5878.  
  5879.                                                             ----------
  5880.                                                               $7750.00
  5881. Paperback Software
  5882. 910213 PSI50    Paperback Software   VPPLA       1   149.00    $149.00
  5883. 910213 PSI50    Paperback Software   VPEXP      54   179.00   $9666.00
  5884. 910213 PSI50    Paperback Software   VPINF       1   199.00    $199.00
  5885. 910213 PSI50    Paperback Software   VPPLA     285   149.00  $42465.00
  5886.      13-Feb-1991                                             $52479.00
  5887.  
  5888.                                                             ----------
  5889.                                                              $52479.00
  5890. Sub Rosa Inc.
  5891. 910213 SUB50    Sub Rosa Inc.        VPINF      10   199.00   $1990.00
  5892. 910213 SUB50    Sub Rosa Inc.        VPPLU       2   249.00    $498.00
  5893. 910213 SUB50    Sub Rosa Inc.        VPPLA       1   149.00    $149.00
  5894. 910213 SUB50    Sub Rosa Inc.        VPPLU      85   249.00  $21165.00
  5895.      13-Feb-1991                                             $23802.00
  5896.  
  5897.                                                             ----------
  5898.                                                              $23802.00
  5899.                                                             ==========
  5900.                                                              $84031.00
  5901.  
  5902. ──────────────────────────────────────────────────────────────────────
  5903.  
  5904.  
  5905. ──────────────────────────────────────────────────────────────────────
  5906.                                                        Figure 4
  5907. * NOFIND.FRM    report form listing all invoices for customers
  5908. *               not found in CUST.DBF
  5909. FILE - invoice
  5910. FILE - cust INDEX custcode
  5911. RELATION - custcode TO 2
  5912. FIELDS - date,custcode,invoice,itemcode,quant,price,price*quant
  5913. HEADING - DATE,CUSTOMER,INVOICE,ITEM,QUANTITY,PRICE,TOTAL
  5914. PICTURE - ,,,,,,$$$$$$9.99
  5915. PRINT
  5916. TITLE - Invoices For Customers Not In Customer Data File
  5917. SELECT - custcode<>'   '
  5918.  
  5919.  
  5920.  
  5921.  
  5922.  
  5923.  
  5924.      REPORT                     VPI1  VPI  VPIN                      REPORT
  5925.      VP-Info Level 1 Reference Manual           Page 326          SECTION 4
  5926.  
  5927.  
  5928.  
  5929.  
  5930.                                     RESTORE
  5931.  
  5932.      Restore memory variables from file.
  5933.  
  5934.      ╔════════════════════════════════════════════════════════════════════╗
  5935.      ║ RESTORE FROM <file> [ADDITIVE]                                     ║
  5936.      ║                                                                    ║
  5937.      ║ <file>             name of memory variable file                    ║
  5938.      ╟────────────────────────────────────────────────────────────────────╢
  5939.      ║ Option:                                                            ║
  5940.      ║                                                                    ║
  5941.      ║ ADDITIVE           add new variables, update old ones              ║
  5942.      ╚════════════════════════════════════════════════════════════════════╝
  5943.  
  5944.           This command is used for restoring the memory and system
  5945.      variables that had previously been saved by the SAVE TO command.  This
  5946.      command erases all the variables that are currently in memory.  (See
  5947.      the command SAVE TO.)
  5948.  
  5949.           The ADDITIVE clause inhibits clearing of memory variables.  It
  5950.      adds the memory variables from the file to the memory variable table.
  5951.      If a memory variable occurs both in the table and the file, its value
  5952.      gets updated from the file.  With the ADDITIVE clause, the position of
  5953.      the existing variables in the memory variable table does not change,
  5954.      so pointers to them remain correct.
  5955.  
  5956.        /--------------------------------------------------------------\
  5957.        |     In general, the ADDITIVE clause is not needed in         |
  5958.        |  Conversational VP-Info, but must ALWAYS be used in programs.|
  5959.        `--------------------------------------------------------------'
  5960.  
  5961.           This command should be used with the utmost care.  Compiled
  5962.      programs set pointers to memory variables.  If the memory variables
  5963.      are restored, the restore must be absolute, not dependent on some
  5964.      conditions.  (See Appendix A.  At compilation, the memory variable
  5965.      file must be present.)
  5966.  
  5967.           Example:
  5968.  
  5969.      1>LIST MEMO
  5970.  
  5971.      Name          Type    Width    Contents
  5972.      NAME            C       5      David
  5973.      AGE             N       8      11
  5974.      ** Total **  2  variables, 13  bytes
  5975.      1>SAVE TO child
  5976.      1>QUIT
  5977.      C:\>SRI
  5978.      1>RESTORE FROM child
  5979.  
  5980.  
  5981.  
  5982.  
  5983.      RESTORE                    VPI1  VPI  VPIN                     RESTORE
  5984.      VP-Info Level 1 Reference Manual           Page 327          SECTION 4
  5985.  
  5986.  
  5987.      1>LIST MEMO
  5988.  
  5989.      Name          Type    Width    Contents
  5990.      NAME            C       5      David
  5991.      AGE             N       8      11
  5992.      ** Total **  2  variables, 13  bytes
  5993.  
  5994.  
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.  
  6014.  
  6015.  
  6016.  
  6017.  
  6018.  
  6019.  
  6020.  
  6021.  
  6022.  
  6023.  
  6024.  
  6025.  
  6026.  
  6027.  
  6028.  
  6029.  
  6030.  
  6031.  
  6032.  
  6033.  
  6034.  
  6035.  
  6036.  
  6037.  
  6038.  
  6039.  
  6040.      RESTORE                    VPI1  VPI  VPIN                     RESTORE
  6041.      VP-Info Level 1 Reference Manual           Page 328          SECTION 4
  6042.  
  6043.  
  6044.  
  6045.                                      RETURN
  6046.  
  6047.      Return to the calling program.
  6048.  
  6049.      ╔════════════════════════════════════════════════════════════════════╗
  6050.      ║ RETURN                                                             ║
  6051.      ╚════════════════════════════════════════════════════════════════════╝
  6052.  
  6053.           The RETURN command returns the current program to the program
  6054.      from which it was called with the DO command.
  6055.  
  6056.           There may be any number of RETURN commands in a program. (See
  6057.      also the command DO.)
  6058.  
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065.  
  6066.  
  6067.  
  6068.  
  6069.  
  6070.  
  6071.  
  6072.  
  6073.  
  6074.  
  6075.  
  6076.  
  6077.  
  6078.  
  6079.  
  6080.  
  6081.  
  6082.  
  6083.  
  6084.  
  6085.  
  6086.  
  6087.  
  6088.  
  6089.  
  6090.  
  6091.  
  6092.  
  6093.  
  6094.  
  6095.  
  6096.  
  6097.      RETURN                     VPI1  VPI  VPIN                      RETURN
  6098.      VP-Info Level 1 Reference Manual           Page 329          SECTION 4
  6099.  
  6100.  
  6101.  
  6102.                                       RING
  6103.  
  6104.      Sound a beep on the computer speaker.
  6105.  
  6106.      ╔════════════════════════════════════════════════════════════════════╗
  6107.      ║ RING                                                               ║
  6108.      ╚════════════════════════════════════════════════════════════════════╝
  6109.  
  6110.           The RING command has different effects in Level 1 and VP-Info
  6111.      Professional; refer to the section applying to you.
  6112.  
  6113.           A.   In VP-Info Professional without the NOEFFECTS keyword in the
  6114.                VPI.SET file:
  6115.  
  6116.                RING uses one of the sound effects from its effect library,
  6117.                and does not send anything to the screen.
  6118.  
  6119.           B.   In Level 1 (and in VP-Info Professional with the NOEFFECTS
  6120.                keyword in the VPI.SET file):
  6121.  
  6122.                RING sends character 7 (the ASCII bell character) to the
  6123.                screen at the current cursor position.  If there is already
  6124.                a character in that position, it will be overwritten
  6125.                (erased).
  6126.  
  6127.           See the SOUND command.
  6128.  
  6129.  
  6130.  
  6131.  
  6132.  
  6133.  
  6134.  
  6135.  
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141.  
  6142.  
  6143.  
  6144.  
  6145.  
  6146.  
  6147.  
  6148.  
  6149.  
  6150.  
  6151.  
  6152.  
  6153.  
  6154.      RING                       VPI1  VPI  VPIN                        RING
  6155.      VP-Info Level 1 Reference Manual           Page 330          SECTION 4
  6156.  
  6157.  
  6158.  
  6159.                                       RUN
  6160.  
  6161.      Execute DOS commands or run a program outside VP-Info Level 1.
  6162.  
  6163.      ╔════════════════════════════════════════════════════════════════════╗
  6164.      ║ RUN <command file>/<DOS command>                                   ║
  6165.      ║                                                                    ║
  6166.      ║ <command file>   an EXE, COM or BAT file to be executed            ║
  6167.      ║ <DOS command>    an internal DOS command (COMMAND.COM must be      ║
  6168.      ║                    in the current directory or in the PATH         ║
  6169.      ╚════════════════════════════════════════════════════════════════════╝
  6170.  
  6171.           Provided your computer has sufficient memory available, the RUN
  6172.      command allows you to execute DOS commands and run small programs
  6173.      outside VP-Info Level 1 without leaving VP-Info Level 1.
  6174.  
  6175.           The amount of memory devoted to VP-Info is controlled by the
  6176.      MEMORY= command in the VPI.SET file, but cannot be changed from the
  6177.      default configuration in Level 1.  The default is to use as much high
  6178.      memory as possible up to 128K.  See MEMORY= and BINSPACE= commands.
  6179.  
  6180.           Examples:
  6181.  
  6182.      1>RUN chkdsk                  ;check current disk...CHKDSK must be
  6183.                                    ;in current directory or path
  6184.  
  6185.      1>RUN editor test             ;use an editor on file TEST...EDITOR
  6186.                                    ;must be in current directory or path
  6187.  
  6188.      1>RUN mode com1:1200,n,8,1    ;configure the COM1: port...MODE must be
  6189.                                    ;in current directory or path
  6190.  
  6191.  
  6192.  
  6193.  
  6194.  
  6195.  
  6196.  
  6197.  
  6198.  
  6199.  
  6200.  
  6201.  
  6202.  
  6203.  
  6204.  
  6205.  
  6206.  
  6207.  
  6208.  
  6209.  
  6210.  
  6211.      RUN                        VPI1  VPI  VPIN                         RUN
  6212.      VP-Info Level 1 Reference Manual           Page 331          SECTION 4
  6213.  
  6214.  
  6215.  
  6216.                                       SAVE
  6217.  
  6218.      Save the memory variables to a file.
  6219.  
  6220.      ╔════════════════════════════════════════════════════════════════════╗
  6221.      ║ SAVE TO <file>                                                     ║
  6222.      ║                                                                    ║
  6223.      ║ <file>           the name of the memory variable file              ║
  6224.      ╚════════════════════════════════════════════════════════════════════╝
  6225.  
  6226.           This command is used to save the memory variables to a file.
  6227.      These can later be restored using the RESTORE FROM command. (See
  6228.      RESTORE FROM.)
  6229.  
  6230.           If no extension is given to the file name, the file will have
  6231.      extension MEM.
  6232.  
  6233.           During debugging, you may save the memory variables to a file for
  6234.      later analysis.
  6235.  
  6236.           Example:
  6237.  
  6238.      1>LIST MEMO
  6239.  
  6240.      Name          Type    Width    Contents
  6241.      ** Total **  0  variables, 0  bytes
  6242.      1>name='David'
  6243.      1>age=11
  6244.      1>LIST MEMO
  6245.  
  6246.      Name          Type    Width    Contents
  6247.      NAME            C       5      David
  6248.      AGE             N       8      11
  6249.      ** Total **  2  variables, 13  bytes
  6250.      1>SAVE TO child
  6251.      1>QUIT
  6252.      C:\>SRI
  6253.      1>RESTORE FROM child
  6254.      1>LIST MEMO
  6255.      Name          Type    Width    Contents
  6256.      NAME            C       5      David
  6257.      AGE             N       8      11
  6258.      ** Total **  2  variables, 13  bytes
  6259.  
  6260.  
  6261.  
  6262.  
  6263.  
  6264.  
  6265.  
  6266.  
  6267.  
  6268.      SAVE                       VPI1  VPI  VPIN                        SAVE
  6269.      VP-Info Level 1 Reference Manual           Page 332          SECTION 4
  6270.  
  6271.  
  6272.  
  6273.                                      SCOPE
  6274.  
  6275.      Limit the records available within the current master index to those
  6276.      matching all or part of the current records index key.  A synonym for
  6277.      LIMIT command.
  6278.  
  6279.      ╔════════════════════════════════════════════════════════════════════╗
  6280.      ║ SCOPE <num exp>                                                    ║
  6281.      ║ SCOPE <key exp>                                                    ║
  6282.      ║ SCOPE                                                              ║
  6283.      ╟────────────────────────────────────────────────────────────────────╢
  6284.      ║ Options:                                                           ║
  6285.      ║                                                                    ║
  6286.      ║ <num exp>     the number of characters in the key expression to    ║
  6287.      ║                 to match                                           ║
  6288.      ║ <key exp>     the string expression to match in the current master ║
  6289.      ║                 index                                              ║
  6290.      ╚════════════════════════════════════════════════════════════════════╝
  6291.  
  6292.           When the current file has an index, VP-Info Level 1 can be made
  6293.      to treat the file as though it includes only those records matching
  6294.      the current record's key expression, or some leftmost part of it.
  6295.      When a SCOPE is in effect, no VP-Info Level 1 command can access a
  6296.      record outside that limit.
  6297.  
  6298.           You can most quickly implement this command by using the
  6299.      <num exp> option.  The effect is to have VP-Info Level 1 set the SCOPE
  6300.      to the leftmost <num exp> characters of the key expression of the
  6301.      master index. If <num exp> exceeds the length of the key, the effect
  6302.      is identical to setting the SCOPE to the entire index expression.
  6303.  
  6304.           When SCOPE is used with no option, or when <num exp> is zero, the
  6305.      limit is deactivated.
  6306.  
  6307.           Using SCOPE with <key exp> requires precision is its use to avoid
  6308.      problems that may become extremely serious. Note that the <key exp>
  6309.      expression must be the same as the master index key in use at the
  6310.      moment, or some LEFT( portion of it. Do not attempt to use an
  6311.      expression that does not meet this requirement.
  6312.  
  6313.           Cautions:
  6314.  
  6315.           A.   FIND should not be used on a file with an active limit.  If
  6316.                you choose to do so, be certain that the FIND will be
  6317.                successful.  An unsuccessful FIND places the record pointer
  6318.                on record 0 which is by definition not in the index.  This
  6319.                causes an error, suspends operation of a program, and turns
  6320.                off the SCOPE.
  6321.  
  6322.  
  6323.  
  6324.  
  6325.      SCOPE                      VPI1  VPI  VPIN                       SCOPE
  6326.      VP-Info Level 1 Reference Manual           Page 333          SECTION 4
  6327.  
  6328.  
  6329.           B.   Do not use REPLACE ALL on a field included in an active
  6330.                limit expression, since upon completion, no records will be
  6331.                included in the limit; the result is the same as above.
  6332.  
  6333.           C.   Do not use APPEND, APPEND BLANK or BROWSE APPEND, or enter
  6334.                "append mode" in EDIT, while a limit is active unless you
  6335.                are sure to make all new records equal to the current SCOPE
  6336.                key before leaving the new records.  Doing so causes the
  6337.                file to move outside the SCOPE; the result is the same as
  6338.                above.
  6339.  
  6340.           D.   SCOPE should be used with extreme care, and left in effect
  6341.                for the minimum number of commands possible.  For instance,
  6342.                if used with BROWSE, SCOPE should be invoked immediately
  6343.                before the BROWSE command and canceled immediately
  6344.                afterward.
  6345.  
  6346.           E.   SCOPE should be canceled before closing the index or the
  6347.                file with which it is active, or before the master index is
  6348.                changed with SET INDEX TO n.  If not done by the user or
  6349.                programmer, the SCOPE is automatically turned off by
  6350.                VP-Info Level 1.
  6351.  
  6352.           F.   SCOPE cannot be used with a string constant instead of a
  6353.                <key exp>.  The <key exp> can be implemented with a macro.
  6354.  
  6355.           G.   SCOPE is a synonym for the LIMIT command, and can be used
  6356.                interchangeably.
  6357.  
  6358.  
  6359.  
  6360.  
  6361.  
  6362.  
  6363.  
  6364.  
  6365.  
  6366.  
  6367.  
  6368.  
  6369.  
  6370.  
  6371.  
  6372.  
  6373.  
  6374.  
  6375.  
  6376.  
  6377.  
  6378.  
  6379.  
  6380.  
  6381.  
  6382.      SCOPE                      VPI1  VPI  VPIN                       SCOPE
  6383.      VP-Info Level 1 Reference Manual           Page 334          SECTION 4
  6384.  
  6385.  
  6386.  
  6387.                                      SCREEN
  6388.  
  6389.      Save and restore screen images between the displayed screen and up to
  6390.      three additional background screens.
  6391.  
  6392.      ╔════════════════════════════════════════════════════════════════════╗
  6393.      ║ One of three forms:                                                ║
  6394.      ║ 1. SCREEN <source>,<destination>                                   ║
  6395.      ║ 2. SCREEN <destination>                                            ║
  6396.      ║ 3. SCREEN <effect>                                                 ║
  6397.      ║                                                                    ║
  6398.      ║ <source>      the number of the screen to be transferred to        ║
  6399.      ║                 destination in form 1                              ║
  6400.      ║ <destination> screen number to which all screen output in to be    ║
  6401.      ║                 directed in form 1; the "active" screen in form 2  ║
  6402.      ║ <effect>      transfer the stored image of Screen 2 to Screen 1    ║
  6403.      ║                 (the visible screen) in form 3; transfer uses the  ║
  6404.      ║                 named effect in VP-Info Professional only if       ║
  6405.      ║                 NOEFFECTS not in CNF file                          ║
  6406.      ╚════════════════════════════════════════════════════════════════════╝
  6407.  
  6408.           Screen 1 is the screen the user can see, although screen output
  6409.      can be directed to any of three background screens, numbered 2 through
  6410.      4, and images can be transferred directly from any one to any other.
  6411.  
  6412.           In VP-Info Professional, the visual impact of these transfers can
  6413.      be enhanced by using any of seven special effects, each accompanied by
  6414.      a characteristic sound effect.  The seven special effects are achieved
  6415.      by naming it with one of these keywords:
  6416.  
  6417.           Keyword   Effect
  6418.  
  6419.           Tear      Push the current screen up and to the right
  6420.           Left      Push the current screen to the left
  6421.           Right     Push the current screen to the right
  6422.           Up        Push the current screen up
  6423.           Down      Push the current screen down
  6424.           Open      Expose Screen 2 gradually from the middle
  6425.           Close     Push the current screen into itself at the middle
  6426.  
  6427.           Shortcut: When specifying effect by name, only the first
  6428.           character is required.
  6429.  
  6430.           In all cases, these effects move screen 2 to Screen 1; in order
  6431.      to see to effect, the active screen should be Screen 1.
  6432.  
  6433.           In its default mode, color attributes and cursor positions are
  6434.      stored and restored automatically.  SET SCREEN OFF to allow color
  6435.      attributes and cursor position to be unaffected by the SCREEN command.
  6436.  
  6437.  
  6438.  
  6439.  
  6440.      SCREEN                     VPI1  VPI  VPIN                      SCREEN
  6441.      VP-Info Level 1 Reference Manual           Page 335          SECTION 4
  6442.  
  6443.  
  6444.  
  6445.           Example in a program:
  6446.  
  6447.      SCREEN 2          ;direct output to background screen
  6448.      <commands>        ;draw the background screen
  6449.      SCREEN 1          ;make the visible screen active
  6450.      SCREEN TEAR       ;use effect to move Screen 2 to 1 -- in Level 1 ,
  6451.                        ;  or VP-Info with NOEFFECTS, same as SCREEN 2,1
  6452.  
  6453.  
  6454.  
  6455.  
  6456.  
  6457.  
  6458.  
  6459.  
  6460.  
  6461.  
  6462.  
  6463.  
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.  
  6470.  
  6471.  
  6472.  
  6473.  
  6474.  
  6475.  
  6476.  
  6477.  
  6478.  
  6479.  
  6480.  
  6481.  
  6482.  
  6483.  
  6484.  
  6485.  
  6486.  
  6487.  
  6488.  
  6489.  
  6490.  
  6491.  
  6492.  
  6493.  
  6494.  
  6495.  
  6496.  
  6497.      SCREEN                     VPI1  VPI  VPIN                      SCREEN
  6498.      VP-Info Level 1 Reference Manual           Page 336          SECTION 4
  6499.  
  6500.  
  6501.  
  6502.                                      SCROLL
  6503.  
  6504.      Scroll a part of the screen.
  6505.  
  6506.      ╔════════════════════════════════════════════════════════════════════╗
  6507.      ║ SCROLL <line1>,<line2>                                             ║
  6508.      ║                                                                    ║
  6509.      ║ <line1>      from this line number                                 ║
  6510.      ║ <line2>      to this line number                                   ║
  6511.      ╚════════════════════════════════════════════════════════════════════╝
  6512.  
  6513.           Scroll the screen up one line from line number line1 to line
  6514.      number line2; line1 and line2 are numeric expressions. If line1 is
  6515.      less than line2, the scrolling is reversed.  line1 cannot equal line2.
  6516.  
  6517.           This command is used to scroll text on the screen.
  6518.  
  6519.           Examples:
  6520.  
  6521.           1.
  6522.  
  6523.      1>SCROLL 2,5
  6524.      1>SCROLL 5,2
  6525.  
  6526.           2. Scrolling demo.  Needs two data files: CUST, with fields CUSTN
  6527.      (customer number), NAME (customer name), ADD:1 (address); INVEN with
  6528.      fields: STYLE, COLOR, DESCRIPT, QUANT, COST.
  6529.  
  6530.      USE cust
  6531.      USE#2 inven
  6532.      @ 2,0 SAY CEN('VP-Info can scroll windows',80)
  6533.      @ 5,0 SAY CEN('windows can scroll up !',80)
  6534.      DELAY .5
  6535.      @ 7,0 SAY 'CUSTN  NAME                           ADDRESS'
  6536.      REPEAT 5 TIMES VARYING i
  6537.         ? custn,name,add:1,i
  6538.         SKIP
  6539.         DELAY .5
  6540.      ENDREPEAT
  6541.      REPEAT 5 TIMES
  6542.         SCROLL 8 12
  6543.         @ 12,0
  6544.         ?? custn,name,add:1
  6545.         DELAY .5
  6546.         SKIP
  6547.      ENDREPEAT
  6548.      @ 14,0 SAY CEN('and windows can scroll down',80)
  6549.      DELAY .5
  6550.      @ 16,0 SAY 'STYLE  COL DESCRIPTION          QUANT    COST'
  6551.  
  6552.  
  6553.  
  6554.      SCROLL                     VPI1  VPI  VPIN                      SCROLL
  6555.      VP-Info Level 1 Reference Manual           Page 337          SECTION 4
  6556.  
  6557.  
  6558.      DELAY .5
  6559.      SELECT 2
  6560.      REPEAT 5 TIMES VARYING i
  6561.         ? style,color,descript,quant,cost,i
  6562.         SKIP
  6563.         DELAY .5
  6564.      ENDREPEAT
  6565.      REPEAT 5 TIMES
  6566.         SCROLL 21 17
  6567.         @ 17,0
  6568.         ?? style,color,descript,quant,cost
  6569.         DELAY .5
  6570.         SKIP
  6571.      ENDREPEAT
  6572.  
  6573.  
  6574.  
  6575.  
  6576.  
  6577.  
  6578.  
  6579.  
  6580.  
  6581.  
  6582.  
  6583.  
  6584.  
  6585.  
  6586.  
  6587.  
  6588.  
  6589.  
  6590.  
  6591.  
  6592.  
  6593.  
  6594.  
  6595.  
  6596.  
  6597.  
  6598.  
  6599.  
  6600.  
  6601.  
  6602.  
  6603.  
  6604.  
  6605.  
  6606.  
  6607.  
  6608.  
  6609.  
  6610.  
  6611.      SCROLL                     VPI1  VPI  VPIN                      SCROLL
  6612.      VP-Info Level 1 Reference Manual           Page 338          SECTION 4
  6613.  
  6614.  
  6615.  
  6616.                                       SEEK
  6617.  
  6618.      Find the last record matching a given FIND string by its index in the
  6619.      selected data file.
  6620.  
  6621.      ╔════════════════════════════════════════════════════════════════════╗
  6622.      ║ SEEK <char exp>                                                    ║
  6623.      ║                          VP-Info Professional only                 ║
  6624.      ║                                                                    ║
  6625.      ║ <char exp>   expression to be evaluated and found in the current   ║
  6626.      ║                index                                               ║
  6627.      ╚════════════════════════════════════════════════════════════════════╝
  6628.  
  6629.           SEEK is one of a family of commands that finds a record in an
  6630.      indexed data file by matching a given string with key values in the
  6631.      index file:
  6632.  
  6633.           SEEK is identical to FIND, except that it searches for the match
  6634.                to the value of a character expression instead of a string
  6635.                constant (VP-Info Professional only) (no-find positions the
  6636.                file at the top of file)
  6637.           FIND positions the file on the first record in the index matching
  6638.                the LAST string (no-find positions the file at the top of
  6639.                file)
  6640.           LAST positions the file on the last record in the index matching
  6641.                the FIND string (VP-Info Professional only) (no-find
  6642.                positions the file at the top of file)
  6643.           NEAREST positions the file on the first record in the index equal
  6644.                to or greater than the FIND string (VP-Info Professional
  6645.                only)
  6646.  
  6647.           All forms allow a search to be made on a character expression
  6648.      when the expression if preceded by the macro symbol "&".  When the
  6649.      variable var='TAYLOR', all of the following command lines are
  6650.      equivalent:
  6651.  
  6652.      SEEK var
  6653.      FIND &var
  6654.      SEEK &var
  6655.  
  6656.           If SET DELETE ON, deleted records will not be found.  (See the
  6657.      command SET.)
  6658.  
  6659.           Numbers must always be treated as strings, even if the key
  6660.      expression is a numeric field.  If NUM is a numeric field of width 2,
  6661.      FIND 1 will not find 1, but SEEK STR(1,2) or SEEK ' 1' will be
  6662.      successful.
  6663.  
  6664.  
  6665.  
  6666.  
  6667.  
  6668.      SEEK                           VPI  VPIN                          SEEK
  6669.      VP-Info Level 1 Reference Manual           Page 339          SECTION 4
  6670.  
  6671.  
  6672.           When SEEK is successful, the value of the current record pointer
  6673.      (as shown by the # and RECNO( functions) is set to the current record
  6674.      number, and the system variable :NEAR is set to the same number.
  6675.  
  6676.           If the record is not found, the current record pointer will be
  6677.      set to 0 and the value of :NEAR will be set to the number of the first
  6678.      record in the index with an index key greater than the FIND string; if
  6679.      the index contains no key greater than the FIND string, :NEAR is set
  6680.      to the bottom of the file and EOF( is set to T (true).
  6681.  
  6682.  
  6683.  
  6684.  
  6685.  
  6686.  
  6687.  
  6688.  
  6689.  
  6690.  
  6691.  
  6692.  
  6693.  
  6694.  
  6695.  
  6696.  
  6697.  
  6698.  
  6699.  
  6700.  
  6701.  
  6702.  
  6703.  
  6704.  
  6705.  
  6706.  
  6707.  
  6708.  
  6709.  
  6710.  
  6711.  
  6712.  
  6713.  
  6714.  
  6715.  
  6716.  
  6717.  
  6718.  
  6719.  
  6720.  
  6721.  
  6722.  
  6723.  
  6724.  
  6725.      SEEK                           VPI  VPIN                          SEEK
  6726.      VP-Info Level 1 Reference Manual           Page 340          SECTION 4
  6727.  
  6728.  
  6729.  
  6730.                                      SELECT
  6731.  
  6732.      Select the file number to work with.
  6733.  
  6734.      ╔════════════════════════════════════════════════════════════════════╗
  6735.      ║ SELECT <num const>/PRIMARY/SECONDARY                               ║
  6736.      ║                                                                    ║
  6737.      ║ <num const>    a file number between 1 and 6 Level 1, or between   ║
  6738.      ║                     1 and 10 VP-Info                               ║
  6739.      ║ PRIMARY          same as 1                                         ║
  6740.      ║ SECONDARY        same as 2                                         ║
  6741.      ╚════════════════════════════════════════════════════════════════════╝
  6742.  
  6743.           This command selects a file number, <num const>.  Once this
  6744.      number has been selected, the data files opened with the USE command
  6745.      will be referred to as file <num const>.
  6746.  
  6747.           (For compatibility with older VP-Info programs, file 1 is also
  6748.      called the PRIMARY file and File 2 is also called the SECONDARY file.)
  6749.  
  6750.           In Level 1 and VP-Info, there can be six or ten data files open
  6751.      at the same time; each must have a different file number.
  6752.  
  6753.           SELECT 1, SELECT 2, and so on are regarded as command verbs; no
  6754.      part of the command can be in a macro.
  6755.  
  6756.           Examples:
  6757.  
  6758.      1>SELECT 4
  6759.      4>SELECT SECONDARY
  6760.  
  6761.           You can temporarily change the selected file by putting the file
  6762.      number after the command keyword.
  6763.  
  6764.           Example:
  6765.  
  6766.      1>SELECT 1
  6767.      1>USE invoice
  6768.      1>USE#2 customer
  6769.      1>LIST
  6770.  
  6771.           The LIST command will list from the invoice file and the customer
  6772.      file will be opened as file 2.
  6773.  
  6774.           Note to dBASE programmers:  No version of dBASE uses file numbers
  6775.      the way VP-Info Level 1 does, but both have a method of field
  6776.      redirection that must be adjusted when porting dBASE applications to
  6777.      VP-Info Level 1.  dBASE II named fields in a different work area by
  6778.      preceding the name with P. or S. to indicate Primary or Secondary work
  6779.  
  6780.  
  6781.  
  6782.  
  6783.      SELECT                     VPI1  VPI  VPIN                      SELECT
  6784.      VP-Info Level 1 Reference Manual           Page 341          SECTION 4
  6785.  
  6786.  
  6787.      area. dBASE III and later versions use aliases, established when the
  6788.      file is opened with USE, that are linked to a field name with an arrow
  6789.      (example: cust->name).  Your first step in program conversion is
  6790.      replacing these constructs with VP-Info Level 1 file-numbering scheme
  6791.      (example: cust#2).
  6792.  
  6793.  
  6794.  
  6795.  
  6796.  
  6797.  
  6798.  
  6799.  
  6800.  
  6801.  
  6802.  
  6803.  
  6804.  
  6805.  
  6806.  
  6807.  
  6808.  
  6809.  
  6810.  
  6811.  
  6812.  
  6813.  
  6814.  
  6815.  
  6816.  
  6817.  
  6818.  
  6819.  
  6820.  
  6821.  
  6822.  
  6823.  
  6824.  
  6825.  
  6826.  
  6827.  
  6828.  
  6829.  
  6830.  
  6831.  
  6832.  
  6833.  
  6834.  
  6835.  
  6836.  
  6837.  
  6838.  
  6839.  
  6840.      SELECT                     VPI1  VPI  VPIN                      SELECT
  6841.      VP-Info Level 1 Reference Manual           Page 342          SECTION 4
  6842.  
  6843.  
  6844.  
  6845.                                       SET
  6846.  
  6847.      Set up environmental controls.
  6848.  
  6849.      ╔════════════════════════════════════════════════════════════════════╗
  6850.      ║ SET <param> ON/OFF                                                 ║
  6851.      ║                                                                    ║
  6852.      ║ <param>   is chosen from the list:                                 ║
  6853.      ║               ADD, ALTERNATE, ANSI, BELL, CARRY, CONFIRM,          ║
  6854.      ║               CONSOLE, DEBUG, DELETED, DELIMITER, DISPLAY,         ║
  6855.      ║               DIVZERO, DO, ECHO, EJECT, END, ERROR, ESCAPE,        ║
  6856.      ║               EXACT, EXECUTION, FUNCTION, GET, HEADING,            ║
  6857.      ║               INTENSITY, KEEP, LINE, LOCK, MENU, MONO, NETWORK,    ║
  6858.      ║               PRINT, PROMPT, RAW, SAVE, SCREEN, SNOW,              ║
  6859.      ║               STEP, TALK, TEXT, TRIM, UPPER, ZERO                  ║
  6860.      ╟────────────────────────────────────────────────────────────────────╢
  6861.      ║ Switch:                                                            ║
  6862.      ║                                                                    ║
  6863.      ║ ON or OFF                                                          ║
  6864.      ╚════════════════════════════════════════════════════════════════════╝
  6865.  
  6866.           These parameters enable and disable certain features of
  6867.      VP-Info Level 1.  The features are explained below.
  6868.  
  6869.           VP-Info Level 1 comes with some of these features on, and some
  6870.      off; an asterisk marks the default.
  6871.  
  6872.      Parameter   Switch  Explanation:
  6873.  
  6874.      ADD         ON      When doing a POST, and the find is unsuccessful, a
  6875.                             record will be appended to the Master File, the
  6876.                             non-numeric fields of the Master File record
  6877.                             will be replaced by the matching fields in the
  6878.                             Transaction File record, and, the posting is
  6879.                             done to the new record.
  6880.                 *OFF     When doing a POST, and the find is unsuccessful,
  6881.                             an error message is sent.
  6882.  
  6883.      ALTERNATE   ON      An alternative to SET PRINT ON and SET FORMAT TO
  6884.                             PRINT commands: output that would be sent to
  6885.                             the printer is sent to a disk text file
  6886.                             instead.  The name of the disk file is
  6887.                             specified in the SET ALTERNATE TO <file>
  6888.                             command (see also SET ALTERNATE TO.  SET PRINT
  6889.                             ON is ignored when SET ALTERNATE ON.
  6890.                 *OFF     Stop sending output to the disk file. (NOTE: SET
  6891.                             PRINT OFF also sets ALTERNATE OFF if ALTERNATE
  6892.                             ON. Do not mix SET PRINT and SET ALTERNATE
  6893.                             commands, however; only use these commands in
  6894.                             ON/OFF pairs.)
  6895.  
  6896.  
  6897.      SET                        VPI1  VPI  VPIN                         SET
  6898.      VP-Info Level 1 Reference Manual           Page 343          SECTION 4
  6899.  
  6900.  
  6901.  
  6902.      ANSI        ON      ANSI.SYS is no longer supported for terminal
  6903.                             emulations by VP-Info Level 1, but the SET ANSI
  6904.                             command is allowed for compatibility with
  6905.                             programs written for earlier versions. It has
  6906.                             no effect.
  6907.                 *OFF     SET ANSI has no effect in VP-Info Level 1.
  6908.  
  6909.      BELL       *ON      The computer rings the bell whenever illegal data
  6910.                             is entered or when data input goes from an
  6911.                             editing field to the next editing field.
  6912.                  OFF     Bell is turned off.
  6913.  
  6914.      CARRY       ON      When in APPEND or the append mode of EDIT, make
  6915.                             the appended record identical to the current
  6916.                             record.
  6917.                 *OFF     Appended records are blank.
  6918.  
  6919.      CONFIRM     ON      In full-screen editing, data entry into an editing
  6920.                             field must be terminated by pressing <ENTER>.
  6921.                             (When filling a numeric field, this condition
  6922.                             will drop the last numeric character, the one
  6923.                             under the cursor.  The remedy is to make the
  6924.                             input picture one character wider.)
  6925.                 *OFF     Once an editing field is filled, data entry
  6926.                             proceeds to the next editing field.
  6927.  
  6928.      CONSOLE    *ON      The output directed to the screen goes to the
  6929.                             screen.  This flag is always set when <Esc> is
  6930.                             pressed or VP-Info Level 1 stops execution on
  6931.                             an error.
  6932.                  OFF     All output directed to the screen is suppressed.
  6933.                             (Note, however, that scrolling is not
  6934.                             suppressed by this command, so existing
  6935.                             material on the screen can be scrolled off the
  6936.                             top of the screen.  Consider directing screen
  6937.                             output to a background screen instead of SET
  6938.                             CONSOLE OFF.)
  6939.  
  6940.      DEBUG       ON      Activate all the DEBUG print commands.
  6941.                 *OFF     Ignore all the DEBUG print commands.
  6942.  
  6943.      DELETED     ON      All records with the DELETED flag are ignored by
  6944.                             all the commands except the GOTO command.
  6945.                 *OFF     Records with the DELETED flag are listed, found
  6946.                             with FIND, etc., but marked as DELETED
  6947.                             (however, these records are never appended,
  6948.                             averaged, copied, counted, summed, totalled, or
  6949.                             reported).
  6950.  
  6951.  
  6952.  
  6953.  
  6954.      SET                        VPI1  VPI  VPIN                         SET
  6955.      VP-Info Level 1 Reference Manual           Page 344          SECTION 4
  6956.  
  6957.  
  6958.  
  6959.      DELIMITER   ON      The editing fields in the @ GET, EDIT, BROWSE,
  6960.                             TEXT (@ and % macros) commands are bounded by
  6961.                             colons.
  6962.                 *OFF     These editing fields are not bounded by colons.
  6963.  
  6964.      DISPLAY    *ON      Displayed macros are immediately updated in a TEXT
  6965.                             during READ when their values are changed in an
  6966.                             ON FIELD structure.
  6967.                  OFF     Displayed TEXT macros are not updated during READ.
  6968.  
  6969.      DIVZERO      ON      Division by zero is permitted and does not cause
  6970.                             execution of a program to cease with an error
  6971.                             message; the result of division by zero is
  6972.                             arbitrarily set at zero.
  6973.                 *OFF     Division by zero is not permitted and causes
  6974.                             program execution to abort with an error
  6975.                             message.
  6976.  
  6977.      DO         *ON      Subroutines are compiled as overlays to the
  6978.                             calling program (see DO command).
  6979.                  OFF     Subroutines are not compiled in the calling
  6980.                             program. Instead, the compile produces files
  6981.                             containing the compiled environment for the
  6982.                             subroutines (with the extension ENV).  May be
  6983.                             useful in developing and debugging very complex
  6984.                             applications.
  6985.  
  6986.      ECHO        ON      When compiling a VP-Info Level 1 program
  6987.                             (including the compiling done on-the-fly before
  6988.                             running an uncompiled program), the program
  6989.                             lines are shown on the screen as they are
  6990.                             compiled; it has no effect while programs are
  6991.                             actually being executed.
  6992.                 *OFF     Program lines are not shown.
  6993.  
  6994.      EJECT      *ON      In a report form file, the EJECT line will send a
  6995.                             form feed character after each subtotal.
  6996.                  OFF     In a report form file, the EJECT line will send
  6997.                             enough carriage returns to move the paper in
  6998.                             the printer to the form depth set by the SET
  6999.                             LENGTH TO command (default is 66).
  7000.  
  7001.  
  7002.  
  7003.  
  7004.  
  7005.  
  7006.  
  7007.  
  7008.  
  7009.  
  7010.  
  7011.      SET                        VPI1  VPI  VPIN                         SET
  7012.      VP-Info Level 1 Reference Manual           Page 345          SECTION 4
  7013.  
  7014.  
  7015.  
  7016.      END        *ON      During READ while SET FUNCTION OFF, pressing any
  7017.                             function key has the same effect as pressing
  7018.                             <End>; READ is exited and the function key
  7019.                             number is stored into :KEY.
  7020.                  OFF     If SET FUNCTION OFF, then all function keys give a
  7021.                             carriage return and line feed combination
  7022.                             (leave input field) and the function key number
  7023.                             is stored in :KEY.  READ is not exited, but
  7024.                             action can be controlled in an ON FIELD
  7025.                             structure.
  7026.  
  7027.      ERROR      *ON      If an ON ERROR structure is in effect, it is
  7028.                             executed in event of an error.
  7029.                  OFF     An active ON ERROR structure is ignored and
  7030.                             VP-Info Level 1 reacts as though the structure
  7031.                             did not exist.
  7032.  
  7033.      ESCAPE     *ON      Hitting <Esc> aborts program execution, or if an
  7034.                             ON ESCAPE structure is in effect, program
  7035.                             execution jumps to the start of the structure.
  7036.                  OFF     <Esc> is ignored.
  7037.  
  7038.      EXACT       ON      Whenever strings are compared for equality (in
  7039.                             conditions, or when invoking FIND), all
  7040.                             characters in both strings, including trailing
  7041.                             blanks, are compared, and only perfect matches
  7042.                             are true.  Thus 'ABCD'='ABC' is false, and FIND
  7043.                             ABC will not find 'ABCD'.
  7044.                 *OFF     Whenever strings are compared for equality,
  7045.                             trailing blanks are ignored, and only the
  7046.                             number of characters to the right of the = sign
  7047.                             are compared.  Thus 'ABCD'='ABC' is true, and
  7048.                             FIND ABC will find 'ABCD' (if 'ABCD' is the
  7049.                             first record key starting with 'ABC').
  7050.  
  7051.      EXECUTION   ON      All FIELD modules in an ON FIELD structure are
  7052.                             executed before exiting READ (or the current
  7053.                             record in BROWSE OFF and EDIT OFF), as well as
  7054.                             when leaving their respective input fields.
  7055.                 *OFF     FIELD modules are executed only when leaving their
  7056.                             respective input fields.
  7057.  
  7058.      FUNCTION   *ON      Function keys display values stored in them when
  7059.                             pressed.
  7060.                 *OFF     Disable the usual functions of the function keys
  7061.                             <F1> to <F10>.  Pressing a function key will
  7062.                             produce a Ctrl-W (or a carriage return/line
  7063.                             feed if SET END OFF); the number of the
  7064.                             function key pressed is available to the
  7065.                             programmer in the :KEY system variable.
  7066.  
  7067.  
  7068.      SET                        VPI1  VPI  VPIN                         SET
  7069.      VP-Info Level 1 Reference Manual           Page 346          SECTION 4
  7070.  
  7071.  
  7072.  
  7073.      GET         ON      A Get Table is maintained when calling a sub-
  7074.                             program; it is, therefore, still in effect upon
  7075.                             return from the sub-program, provided it is not
  7076.                             cleared in the sub-program.  (A Get Table is
  7077.                             cleared either with the CLEAR GETS command, or
  7078.                             by creating a get with TEXT or an @ GET command
  7079.                             after a READ command.)
  7080.                 *OFF     A Get Table is cleared whenever program execution
  7081.                             leaves a sub-program.
  7082.  
  7083.      HEADING     ON      Field names are displayed over each column during
  7084.                             LIST and DISPLAY command execution.  If fields
  7085.                             names are longer than column width, the name is
  7086.                             truncated as in BROWSE.  Headings are not
  7087.                             displayed if an expression list is given on the
  7088.                             LIST or DISPLAY command line.
  7089.                 *OFF     Field names are not displayed with LIST and
  7090.                             DISPLAY.
  7091.  
  7092.      INTENSITY  *ON      The editing fields in full-screen editing are
  7093.                             shown in reverse video.
  7094.                  OFF     Editing fields are shown in normal video.
  7095.  
  7096.      KEEP        ON      When a TEXT file is read from the disk, it is
  7097.                             stored in memory so that subsequent calls for
  7098.                             the same TEXT will use the version in memory
  7099.                             instead of reading it in from the disk again.
  7100.                 *OFF     The disk is accessed every time the TEXT file is
  7101.                             called.  Note: If the TEXT filename is a macro
  7102.                             or variable name, VP-Info Level 1 always goes
  7103.                             to the disk for the text whether SET KEEP is ON
  7104.                             or OFF.
  7105.  
  7106.      LINE       *ON      Place line numbers in compiled program to be used
  7107.                             with error messages.
  7108.                  OFF     No line numbers in compiled program.
  7109.  
  7110.      LOCK        ON      VP-Info Professional Network Edition only.  All
  7111.                             data file records are automatically locked
  7112.                             whenever the user is positioned on them.
  7113.                 *OFF     Records are not automatically locked.
  7114.  
  7115.      MENU        ON      Display the meaning of the editing keys for EDIT
  7116.                             and BROWSE, and help after every ERASE or CLS.
  7117.                 *OFF     No editing keys displayed.
  7118.  
  7119.      MONO        ON      A monochrome monitor is used. (Has no default.
  7120.                             Not required unless both monochrome and color
  7121.                             adapters are present in your computer; put the
  7122.                             appropriate command in your CNF file.)
  7123.                  OFF     A color monitor is used.
  7124.  
  7125.      SET                        VPI1  VPI  VPIN                         SET
  7126.      VP-Info Level 1 Reference Manual           Page 347          SECTION 4
  7127.  
  7128.  
  7129.  
  7130.      NETWORK     ON      Turn network facilities on (VP-Info Professional
  7131.                             Network Edition only; enables the user to LOCK
  7132.                             and UNLOCK records on any network or multi-user
  7133.                             system adhering to the standard conventions of
  7134.                             Microsoft DOS 3.1 and above.  See SET NETWORK
  7135.                             TO command).
  7136.                 *OFF     Network facilities are not turned on (VP-Info
  7137.                             Professional Network Edition only).
  7138.  
  7139.      PRINT       ON      Output produced such by relative display commands
  7140.                             as LIST, DISPLAY, ?, and ?? is sent to a
  7141.                             printer (or to a text file if SPOOL is in
  7142.                             effect).  In the interactive mode, the effect
  7143.                             of SET PRINT ON is turned off when the prompt
  7144.                             appears, so that the commands will not be
  7145.                             printed.  VP-Info Level 1 will continue
  7146.                             printing the results of the commands.
  7147.                 *OFF     The output is sent to the screen.  This flag is
  7148.                             always set OFF when <Esc> is pressed or an
  7149.                             error is encountered while running a program.
  7150.  
  7151.      PROMPT      ON      A dot prompt, as in dBASE.
  7152.                 *OFF     The n> prompt, where n is the file number.
  7153.  
  7154.      RAW         ON      No blanks separate the expressions when the
  7155.                             DISPLAY or LIST command is used with an
  7156.                             expression list (see ?, ??, DISPLAY, and LIST).
  7157.                 *OFF     Blanks are placed between expressions.
  7158.  
  7159.      SAVE       *ON      Changes are saved to disk when the user leaves a
  7160.                             changed record or closes the data file.
  7161.                  OFF     Changes are not written to disk.
  7162.  
  7163.      SCREEN     *ON      SCREEN command works as described under SCREEN
  7164.                             command.
  7165.                  OFF     When screens are switched with SCREEN command,
  7166.                             cursor position and color attributes are not
  7167.                             saved or restored.  (Provided only to allow
  7168.                             user to force compatibility with early versions
  7169.                             of VP-Info.
  7170.  
  7171.      SNOW       *ON      When using a CGA color monitor and some other
  7172.                             monitor types, VP-Info Level 1 may cause screen
  7173.                             flicker called "snow."
  7174.                  OFF     Snow is suppressed, at a cost of slowing screen
  7175.                             displays.
  7176.  
  7177.  
  7178.  
  7179.  
  7180.  
  7181.  
  7182.      SET                        VPI1  VPI  VPIN                         SET
  7183.      VP-Info Level 1 Reference Manual           Page 348          SECTION 4
  7184.  
  7185.  
  7186.  
  7187.      STEP        ON      Execute a VP-Info Level 1 program a line at a time
  7188.                             (with SET LINE ON, the line numbers will be
  7189.                             displayed on the top line of the screen
  7190.                             display).
  7191.                 *OFF     Execute VP-Info Level 1 programs continuously.
  7192.  
  7193.      TALK       *ON      VP-Info Level 1 messages from commands are
  7194.                             displayed.  This flag is always set when <Esc>
  7195.                             is pressed and when the conversational mode is
  7196.                             entered.
  7197.                  OFF     Messages are not displayed.
  7198.  
  7199.      TEXT       *ON      The TEXT display macros created with & and # are
  7200.                             put into the Get Table; usually required for
  7201.                             input screens created with TEXT.
  7202.                  OFF     Display macros are not put into the Get Table;
  7203.                             usually required when using TEXT for printer
  7204.                             output, as in mail-merge programs.
  7205.  
  7206.      TRIM       *ON      The & macro in TEXT trims string variables.
  7207.                  OFF     The trimming is turned off.
  7208.  
  7209.      UPPER       ON      All keyboard-input characters from "a" to "z" are
  7210.                             forced to upper case "A" to "Z"; a software
  7211.                             "Caps Lock".
  7212.                 *OFF     Lower-case keyboard entry is not altered.
  7213.  
  7214.      ZERO       *ON      Display zeros whenever the numeric value zero must
  7215.                             be displayed.
  7216.                  OFF     If the value zero has to be displayed, display
  7217.                             blanks instead.
  7218.  
  7219.  
  7220.  
  7221.  
  7222.  
  7223.  
  7224.  
  7225.  
  7226.  
  7227.  
  7228.  
  7229.  
  7230.  
  7231.  
  7232.  
  7233.  
  7234.  
  7235.  
  7236.  
  7237.  
  7238.  
  7239.      SET                        VPI1  VPI  VPIN                         SET
  7240.      VP-Info Level 1 Reference Manual           Page 349          SECTION 4
  7241.  
  7242.  
  7243.  
  7244.                                  SET ALTERNATE
  7245.  
  7246.      Specify text file for output.
  7247.  
  7248.      ╔════════════════════════════════════════════════════════════════════╗
  7249.      ║ SET ALTERNATE TO <file>                                            ║
  7250.      ║                                                                    ║
  7251.      ║ <file>          text file name                                     ║
  7252.      ╚════════════════════════════════════════════════════════════════════╝
  7253.  
  7254.           The command SET ALTERNATE specifies the text file to be used when
  7255.      the SET ALTERNATE ON command is given.  The default extension of the
  7256.      file is TXT.  If the file already exists, the new data is appended at
  7257.      the end.  (See SET ALTERNATE ON under the SET command.)
  7258.  
  7259.           All data that would normally go to the printer is sent to this
  7260.      file.
  7261.  
  7262.           Example:
  7263.  
  7264.      SET ALTERNATE TO record
  7265.      SET ALTERNATE ON
  7266.      @ 10,0 SAY 'This goes to RECORD.TXT'
  7267.      SET ALTERNATE OFF
  7268.  
  7269.  
  7270.  
  7271.  
  7272.  
  7273.  
  7274.  
  7275.  
  7276.  
  7277.  
  7278.  
  7279.  
  7280.  
  7281.  
  7282.  
  7283.  
  7284.  
  7285.  
  7286.  
  7287.  
  7288.  
  7289.  
  7290.  
  7291.  
  7292.  
  7293.  
  7294.  
  7295.  
  7296.      SET ALTERNATE               VPI1  VPI  VPIN              SET ALTERNATE
  7297.      VP-Info Level 1 Reference Manual           Page 350          SECTION 4
  7298.  
  7299.  
  7300.  
  7301.                                    SET COLOR
  7302.  
  7303.      Set the attribute byte of the characters to be displayed.
  7304.  
  7305.      ╔════════════════════════════════════════════════════════════════════╗
  7306.      ║ SET COLOR TO <attrib>                                              ║
  7307.      ║                                                                    ║
  7308.      ║ <attrib>   numeric expression, the attribute byte: 0 to 255        ║
  7309.      ╚════════════════════════════════════════════════════════════════════╝
  7310.  
  7311.           This command sets the attribute byte of all characters to be
  7312.      displayed on the screen, and updates the system variable :COLOR with
  7313.      <attrib>.  SET COLOR TO 0 returns to the normal mode.  An alternative
  7314.      way of getting the same result is:
  7315.  
  7316.      :COLOR=<attrib>
  7317.  
  7318.           These commands work with standard IBM monochrome and color
  7319.      monitors.
  7320.  
  7321.           Every character displayed on the screen has an attribute byte
  7322.      that determines how the character is displayed.
  7323.  
  7324.           For monochrome monitors: the character may be bold, underlined,
  7325.      reverse, and blink, or any combination of them.  The important numbers
  7326.      are:
  7327.  
  7328.           standard characters       7
  7329.           underline                 1
  7330.           reverse video           112
  7331.  
  7332.           to get bold:        add   8
  7333.           to make it blink:   add 128
  7334.  
  7335.           For color monitors, both the background and the character has
  7336.      color.  Compute ATTRIB by adding up (up to) four numbers:
  7337.      background+foreground+blink+brightness from the following tables:
  7338.  
  7339.           background         0  - black
  7340.                             16  - blue
  7341.                             32  - green
  7342.                             48  - cyan
  7343.                             64  - red
  7344.                             80  - magenta
  7345.                             96  - brown
  7346.                            112  - white
  7347.  
  7348.           foreground         0  - black
  7349.                              1  - blue
  7350.  
  7351.  
  7352.  
  7353.      SET COLOR                  VPI1  VPI  VPIN                   SET COLOR
  7354.      VP-Info Level 1 Reference Manual           Page 351          SECTION 4
  7355.  
  7356.  
  7357.                              2  - green
  7358.                              3  - cyan
  7359.                              4  - red
  7360.                              5  - magenta
  7361.                              6  - brown
  7362.                              7  - white
  7363.  
  7364.           blink              0  - no blink
  7365.                            128  - blink
  7366.  
  7367.           brightness         0  - normal
  7368.                              8  - intense
  7369.  
  7370.           See also the COLOR command for setting the attribute bytes for a
  7371.      rectangular part of the screen.
  7372.  
  7373.           Examples:
  7374.  
  7375.      1>SET COLOR TO 7         ;white on black, the mono default
  7376.      1>SET COLOR TO 48        ;black on light blue, the color default
  7377.      1>SET COLOR TO 58        ;bright green on light blue (48+8+2)
  7378.      1>SET COLOR TO 96        ;black on gold
  7379.      1>SET COLOR TO 112       ;black on white...the mono reverse
  7380.  
  7381.  
  7382.  
  7383.  
  7384.  
  7385.  
  7386.  
  7387.  
  7388.  
  7389.  
  7390.  
  7391.  
  7392.  
  7393.  
  7394.  
  7395.  
  7396.  
  7397.  
  7398.  
  7399.  
  7400.  
  7401.  
  7402.  
  7403.  
  7404.  
  7405.  
  7406.  
  7407.  
  7408.  
  7409.  
  7410.      SET COLOR                  VPI1  VPI  VPIN                   SET COLOR
  7411.      VP-Info Level 1 Reference Manual           Page 352          SECTION 4
  7412.  
  7413.  
  7414.  
  7415.                                     SET DATE
  7416.  
  7417.      Set the default form for dates.
  7418.  
  7419.      ╔════════════════════════════════════════════════════════════════════╗
  7420.      ║ SET DATE TO <str exp>                                              ║
  7421.      ║                                                                    ║
  7422.      ║ <str exp>     the default date format                              ║
  7423.      ╚════════════════════════════════════════════════════════════════════╝
  7424.  
  7425.           This command, in conjunction with the date function DATE(7,
  7426.      <str exp>), is designed to give control over input of dates.  The
  7427.      order of the day, month, and the year, and the number of digits in
  7428.      year (2 or 4), is controlled as follows:
  7429.  
  7430.  
  7431.           SET DATE TO                 formats '12/31/1991' as follows:
  7432.  
  7433.           'mmddyy'                             123191
  7434.           'ddmmyy'                             312191
  7435.           'yymmdd'                             911231
  7436.           'mmddyyyy'                           12311991
  7437.           'ddmmyyyy'                           31121991
  7438.           'yyyymmdd'                           19911231
  7439.  
  7440.  
  7441.           These are the six available options.
  7442.  
  7443.  
  7444.  
  7445.  
  7446.  
  7447.  
  7448.  
  7449.  
  7450.  
  7451.  
  7452.  
  7453.  
  7454.  
  7455.  
  7456.  
  7457.  
  7458.  
  7459.  
  7460.  
  7461.  
  7462.  
  7463.  
  7464.  
  7465.  
  7466.  
  7467.      SET DATE                   VPI1  VPI  VPIN                    SET DATE
  7468.      VP-Info Level 1 Reference Manual           Page 353          SECTION 4
  7469.  
  7470.  
  7471.  
  7472.                                   SET DEFAULT
  7473.  
  7474.      Set the drive letter of the default disk drive for data and index
  7475.      files.
  7476.  
  7477.      ╔════════════════════════════════════════════════════════════════════╗
  7478.      ║ SET DEFAULT TO <drive letter>                                      ║
  7479.      ║                                                                    ║
  7480.      ║ <drive letter>  the drive letter of the default drive              ║
  7481.      ╚════════════════════════════════════════════════════════════════════╝
  7482.  
  7483.           This command sets the drive letter of the default drive for data
  7484.      and index files.  If this drive letter is, say, C, every data and
  7485.      index file will be searched for on drive C, unless the file name
  7486.      contains an explicit drive letter.
  7487.  
  7488.           This command will rarely be used, but is provided for
  7489.      compatibility with older versions of VP-Info Level 1.  Most users will
  7490.      prefer the extra flexibility of the FILES command, the FILES ...
  7491.      ENDFILES structure, and the SET DIR command.  The first two allow you
  7492.      to specify exactly where specific files and groups of files are to be
  7493.      found, and the third actually "logs" you onto any disk and/or
  7494.      directory.
  7495.  
  7496.           See the FILES command, the FILES ... ENDFILES structure, and the
  7497.      SET DIR command.
  7498.  
  7499.           Example:
  7500.  
  7501.      1>SET DEFAULT TO C
  7502.      1>USE employee INDEX a:emp2
  7503.  
  7504.           In this example, the data file EMPLOYEE.DBF will be looked up on
  7505.      drive C:; however, the index file EMP2.NDX will be fetched from
  7506.      drive A:.
  7507.  
  7508.  
  7509.  
  7510.  
  7511.  
  7512.  
  7513.  
  7514.  
  7515.  
  7516.  
  7517.  
  7518.  
  7519.  
  7520.  
  7521.  
  7522.  
  7523.  
  7524.      SET DEFAULT                VPI1  VPI  VPIN                 SET DEFAULT
  7525.      VP-Info Level 1 Reference Manual           Page 354          SECTION 4
  7526.  
  7527.  
  7528.  
  7529.                                     SET DIR
  7530.  
  7531.      Change drive and/or current directory.
  7532.  
  7533.      ╔════════════════════════════════════════════════════════════════════╗
  7534.      ║ SET DIR TO [<drive>:][<directory>]                                 ║
  7535.      ║                                                                    ║
  7536.      ║ <drive>         the drive letter of the new default drive          ║
  7537.      ║ <directory>     the directory name (according to DOS rules)        ║
  7538.      ╚════════════════════════════════════════════════════════════════════╝
  7539.  
  7540.           This command changes the current drive and/or the current
  7541.      directory; equivalent to combining the DOS commands change drive and
  7542.      CHDIR (CD)..
  7543.  
  7544.           Contrast this with the FILES and SET DEFAULT TO commands, which
  7545.      only tell VP-Info Level 1 where to look for certain categories of
  7546.      files without changing the user's current position on the disk.  Exit
  7547.      from VP-Info Level 1 after SET DIR is in the new directory on the new
  7548.      drive.
  7549.  
  7550.           If <drive> is not specified, the new directory is on the same
  7551.      drive.  If directory is not specified, the new directory will be the
  7552.      last directory DOS changed to on the target drive or, if no directory
  7553.      has been changed to, the root of that drive.
  7554.  
  7555.           If <directory> begins with a backslash (example \DATA), the
  7556.      directory will be off the root; if not, the directory will be off the
  7557.      directory onto which the user is currently logged.
  7558.  
  7559.           If the <drive> is invalid, no message will be given, but the
  7560.      change will not take place. If no <drive> is given and the <directory>
  7561.      is invalid, again no change will occur.  However, if <drive> is valid
  7562.      and <directory> is invalid, the drive will change and the user will be
  7563.      logged into the current directory on that drive.
  7564.  
  7565.           The current drive and directory can be checked with the :DIR
  7566.      system variable, which always contains the current drive and directory
  7567.      (example C:\INFO).
  7568.           `
  7569.                Caution: If you change directories within VP-Info Level 1,
  7570.           you may lose track of where some of your files are.  This is
  7571.           particularly likely if you have a FILES structure in use without
  7572.           full path names giving both drive letter and leading backslash on
  7573.           the directory.
  7574.  
  7575.           Example:
  7576.  
  7577.      1>SET DIR TO D:\UTIL
  7578.  
  7579.  
  7580.  
  7581.      SET DIR                    VPI1  VPI  VPIN                     SET DIR
  7582.      VP-Info Level 1 Reference Manual           Page 355          SECTION 4
  7583.  
  7584.  
  7585.      1>? :DIR
  7586.      D:\UTIL
  7587.  
  7588.  
  7589.  
  7590.  
  7591.  
  7592.  
  7593.  
  7594.  
  7595.  
  7596.  
  7597.  
  7598.  
  7599.  
  7600.  
  7601.  
  7602.  
  7603.  
  7604.  
  7605.  
  7606.  
  7607.  
  7608.  
  7609.  
  7610.  
  7611.  
  7612.  
  7613.  
  7614.  
  7615.  
  7616.  
  7617.  
  7618.  
  7619.  
  7620.  
  7621.  
  7622.  
  7623.  
  7624.  
  7625.  
  7626.  
  7627.  
  7628.  
  7629.  
  7630.  
  7631.  
  7632.  
  7633.  
  7634.  
  7635.  
  7636.  
  7637.  
  7638.      SET DIR                    VPI1  VPI  VPIN                     SET DIR
  7639.      VP-Info Level 1 Reference Manual           Page 356          SECTION 4
  7640.  
  7641.  
  7642.  
  7643.                                    SET FIELDS
  7644.  
  7645.      An obsolete command retained in the language for compatibility with
  7646.      earlier versions of VP-Info.
  7647.  
  7648.      ╔════════════════════════════════════════════════════════════════════╗
  7649.      ║ SET FIELDS TO <num const>                                          ║
  7650.      ║                                                                    ║
  7651.      ║ <num const>   the number of fields                                 ║
  7652.      ╚════════════════════════════════════════════════════════════════════╝
  7653.  
  7654.           This command is ignored in VP-Info Level 1. In VP-Info
  7655.      Professional, its role is taken by the FILES= command in the VPI.SET
  7656.      file.
  7657.  
  7658.  
  7659.  
  7660.  
  7661.  
  7662.  
  7663.  
  7664.  
  7665.  
  7666.  
  7667.  
  7668.  
  7669.  
  7670.  
  7671.  
  7672.  
  7673.  
  7674.  
  7675.  
  7676.  
  7677.  
  7678.  
  7679.  
  7680.  
  7681.  
  7682.  
  7683.  
  7684.  
  7685.  
  7686.  
  7687.  
  7688.  
  7689.  
  7690.  
  7691.  
  7692.  
  7693.  
  7694.  
  7695.      SET FIELDS                 VPI1  VPI  VPIN                  SET FIELDS
  7696.      VP-Info Level 1 Reference Manual           Page 357          SECTION 4
  7697.  
  7698.  
  7699.  
  7700.                                    SET FILTER
  7701.  
  7702.      Set a condition which applies to all subsequent data-file commands.
  7703.  
  7704.      ╔════════════════════════════════════════════════════════════════════╗
  7705.      ║ SET FILTER TO [<cond>]                                             ║
  7706.      ║                                                                    ║
  7707.      ╟────────────────────────────────────────────────────────────────────╢
  7708.      ║ Option:                                                            ║
  7709.      ║                                                                    ║
  7710.      ║ <cond>    the condition applied to all subsequent data-file        ║
  7711.      ║             commands                                               ║
  7712.      ╚════════════════════════════════════════════════════════════════════╝
  7713.  
  7714.           Most command that use data files (LIST, REPLACE, REPORT, etc.)
  7715.      allow a selection condition to be specified with a FOR clause.
  7716.  
  7717.           VP-Info Level 1 also allows a global condition to be attached to
  7718.      all data-file commands, including many that do not allow a FOR clause,
  7719.      including SORT, EDIT, and BROWSE.
  7720.  
  7721.           The filter is turned off with  FILTER TO without a condition.
  7722.  
  7723.           While a filter is in effect, a FOR clause can be used with
  7724.      commands to limit further the records subject to the command.
  7725.  
  7726.  
  7727.           Examples:
  7728.  
  7729.           1.   Browse a filtered data file:
  7730.  
  7731.      1>SET FILTER TO amt:due>0
  7732.      1>BROWSE
  7733.  
  7734.           2.   Produce a listing of payables due to vendors in California,
  7735.      only if there is actually an amount due.
  7736.  
  7737.      1>SET FILTER TO amt:due>0
  7738.      1>REPORT owing FOR state='CA'
  7739.  
  7740.  
  7741.  
  7742.  
  7743.  
  7744.  
  7745.  
  7746.  
  7747.  
  7748.  
  7749.  
  7750.  
  7751.  
  7752.      SET FILTER                 VPI1  VPI  VPIN                  SET FILTER
  7753.      VP-Info Level 1 Reference Manual           Page 358          SECTION 4
  7754.  
  7755.  
  7756.  
  7757.                                    SET FORMAT
  7758.  
  7759.      Directs the @ SAY commands to screen or printer.
  7760.  
  7761.      ╔════════════════════════════════════════════════════════════════════╗
  7762.      ║ SET FORMAT TO SCREEN/PRINT                                         ║
  7763.      ╟────────────────────────────────────────────────────────────────────╢
  7764.      ║ Switch:                                                            ║
  7765.      ║                                                                    ║
  7766.      ║ SCREEN     send output to screen; the default                      ║
  7767.      ║ PRINT      send output to printer                                  ║
  7768.      ╚════════════════════════════════════════════════════════════════════╝
  7769.  
  7770.           SET FORMAT TO SCREEN or PRINT is used to send data formatted with
  7771.      the @ SAY command to the screen or the printer (but not to both).  The
  7772.      default is SCREEN.  (See the command @.)  The default is always set
  7773.      when <Esc> is pressed.
  7774.  
  7775.           IF SPOOL or SET ALTERNATE TO has redirected print output to a
  7776.      disk file, SET FORMAT TO PRINT will cause output to go into the disk
  7777.      file.
  7778.  
  7779.  
  7780.  
  7781.  
  7782.  
  7783.  
  7784.  
  7785.  
  7786.  
  7787.  
  7788.  
  7789.  
  7790.  
  7791.  
  7792.  
  7793.  
  7794.  
  7795.  
  7796.  
  7797.  
  7798.  
  7799.  
  7800.  
  7801.  
  7802.  
  7803.  
  7804.  
  7805.  
  7806.  
  7807.  
  7808.  
  7809.      SET FORMAT                 VPI1  VPI  VPIN                  SET FORMAT
  7810.      VP-Info Level 1 Reference Manual           Page 359          SECTION 4
  7811.  
  7812.  
  7813.  
  7814.                                    SET INDEX
  7815.  
  7816.      Specify index files.
  7817.  
  7818.      ╔════════════════════════════════════════════════════════════════════╗
  7819.      ║ SET INDEX TO                                                       ║
  7820.      ║ SET INDEX TO <file>                                                ║
  7821.      ║ SET INDEX TO <file list>                                           ║
  7822.      ║ SET INDEX TO <num const>                                           ║
  7823.      ║                                                                    ║
  7824.      ║ <file>        the name of the index file                           ║
  7825.      ║ <file list>   a list of up to 7 index files                        ║
  7826.      ║ <num const>   a number between 1 and 7                             ║
  7827.      ╚════════════════════════════════════════════════════════════════════╝
  7828.  
  7829.           The command SET INDEX TO specifies the index file(s) to be used
  7830.      with the selected data file.  If more than one index file is given,
  7831.      the first index file will be used as the Master Index.  The Master
  7832.      Index is used by the FIND command, and all the display type commands
  7833.      (BROWSE, LIST).  However, all the index files specified in the list
  7834.      are maintained by the commands that add or edit records (APPEND, EDIT,
  7835.      @ GET, and so on).
  7836.  
  7837.           The Master Index can be changed with the SET INDEX TO <num const>
  7838.      command.  The index files are assigned numbers when they are activated
  7839.      in a file list.  Say, SET INDEX TO 3, makes the third on the list the
  7840.      Master Index.  This involves no disk action; no file is opened or
  7841.      closed.
  7842.  
  7843.           Index files can also be opened with the USE command (see USE).
  7844.  
  7845.           SET INDEX TO with no file name, closes all the index files for
  7846.      the selected data file, but the data file is not closed.  Index files
  7847.      are also closed when the data file is closed. (See the commands CLOSE
  7848.      and USE.)
  7849.  
  7850.           Examples:
  7851.  
  7852.      1>USE employee
  7853.      1>SET INDEX TO employee,empl2,empl3
  7854.      1>LIST
  7855.      1>SET INDEX TO 3        ; makes empl3 the Master Index
  7856.      1>SET INDEX TO          ; closes all index files for the selected file
  7857.  
  7858.  
  7859.  
  7860.  
  7861.  
  7862.  
  7863.  
  7864.  
  7865.  
  7866.      SET INDEX                  VPI1  VPI  VPIN                   SET INDEX
  7867.      VP-Info Level 1 Reference Manual           Page 360          SECTION 4
  7868.  
  7869.  
  7870.  
  7871.                                    SET LENGTH
  7872.  
  7873.      Set page depth for the printer when the printer does not support a
  7874.      standard formfeed control character.
  7875.  
  7876.      ╔════════════════════════════════════════════════════════════════════╗
  7877.      ║ SET LENGTH TO <num exp>                                            ║
  7878.      ║                                                                    ║
  7879.      ║ <num exp>   the page depth                                         ║
  7880.      ╚════════════════════════════════════════════════════════════════════╝
  7881.  
  7882.           The page depth is the number of lines from the top of the page to
  7883.      the very bottom of the page.  If the SET LENGTH command is not used,
  7884.      page depth is assumed to be 66.
  7885.  
  7886.           Warning: SET LENGTH does not set how many lines will be printed
  7887.      on a page but the physical size of the page.  This command is used if
  7888.      the page depth is unusual (e.g., filling in a preprinted form), or if
  7889.      the usual 6 line per inch printing is changed, say, to 8 lines per
  7890.      inch.
  7891.  
  7892.           Example:
  7893.  
  7894.      1>SET LENGTH TO 40
  7895.  
  7896.  
  7897.  
  7898.  
  7899.  
  7900.  
  7901.  
  7902.  
  7903.  
  7904.  
  7905.  
  7906.  
  7907.  
  7908.  
  7909.  
  7910.  
  7911.  
  7912.  
  7913.  
  7914.  
  7915.  
  7916.  
  7917.  
  7918.  
  7919.  
  7920.  
  7921.  
  7922.  
  7923.      SET LENGTH                 VPI1  VPI  VPIN                  SET LENGTH
  7924.      VP-Info Level 1 Reference Manual           Page 361          SECTION 4
  7925.  
  7926.  
  7927.  
  7928.                                   SET LIBRARY
  7929.  
  7930.      Set the drive letter of the default disk drive for data and index
  7931.      files.
  7932.  
  7933.      ╔════════════════════════════════════════════════════════════════════╗
  7934.      ║ SET LIBRARY TO <library>                                           ║
  7935.      ║                                                                    ║
  7936.      ║ <library>     a library file, default extension LIB                ║
  7937.      ╚════════════════════════════════════════════════════════════════════╝
  7938.  
  7939.           This opens a special form of file called a library, which
  7940.      contains up to 65,000 library entries each of 256 bytes.  Library
  7941.      entries are automatically combined into volumes of up to about 20,000
  7942.      characters by creation of an internal linked list, analogous to the
  7943.      way DOS links disk clusters together to make large disk files.
  7944.  
  7945.           If the <library> does not exist, it will be created.  The default
  7946.      extension for library files is LIB.
  7947.  
  7948.           Library volumes can be created only with the WRITE command, and
  7949.      output only with the TEXT command (although a programmer can also
  7950.      access the data through use of the sequential file functions SEEK(,
  7951.      GET(, and PUT( if sufficiently skilled).
  7952.  
  7953.           Both WRITE and TEXT distinguish between standard disk files and
  7954.      volume numbers in their command lines by preceding volume numbers with
  7955.      a period.  Do not mistake this usage for a decimal number.
  7956.  
  7957.           Technical information for experienced programmers: the structure
  7958.      of a library file is as follows:
  7959.  
  7960.           Header:
  7961.  
  7962.             Bits 0 and 1           next volume to be added, an unsigned
  7963.                                      integer
  7964.             Bits 2 and 3           next available volume, an unsigned
  7965.                                      integer; may be less than next to be
  7966.                                      added because existing volumes may
  7967.                                      have been released with REMLIB(
  7968.                                      function or shortened with WRITE
  7969.             Bits 4 through 15      unused
  7970.  
  7971.           Each volume:
  7972.  
  7973.             Bits 0 through 253     the text contents of the volume; end of
  7974.                                      file indicated by 1A hex
  7975.             Bits 254 and 255       a pointer to the next part of the
  7976.                                      volume, an unsigned integer; if no
  7977.                                      next part, pointer is null
  7978.  
  7979.  
  7980.      SET LIBRARY                VPI1  VPI  VPIN                 SET LIBRARY
  7981.      VP-Info Level 1 Reference Manual           Page 362          SECTION 4
  7982.  
  7983.  
  7984.  
  7985.           Example:
  7986.  
  7987.      1>SET LIBRARY TO screens
  7988.      1>? :avail                  ;get number of next available volume
  7989.           65.00
  7990.      1>WRITE .:avail             ;use WRITE to enter a file in volume 65
  7991.  
  7992.  
  7993.  
  7994.  
  7995.  
  7996.  
  7997.  
  7998.  
  7999.  
  8000.  
  8001.  
  8002.  
  8003.  
  8004.  
  8005.  
  8006.  
  8007.  
  8008.  
  8009.  
  8010.  
  8011.  
  8012.  
  8013.  
  8014.  
  8015.  
  8016.  
  8017.  
  8018.  
  8019.  
  8020.  
  8021.  
  8022.  
  8023.  
  8024.  
  8025.  
  8026.  
  8027.  
  8028.  
  8029.  
  8030.  
  8031.  
  8032.  
  8033.  
  8034.  
  8035.  
  8036.  
  8037.      SET LIBRARY                VPI1  VPI  VPIN                 SET LIBRARY
  8038.      VP-Info Level 1 Reference Manual           Page 363          SECTION 4
  8039.  
  8040.  
  8041.  
  8042.                                     SET LINK
  8043.  
  8044.      Set up a physical link between two data files.
  8045.  
  8046.      ╔════════════════════════════════════════════════════════════════════╗
  8047.      ║ SET LINK TO <num const>                                            ║
  8048.      ║ SET LINK OFF                                                       ║
  8049.      ║                                                                    ║
  8050.      ║ <num const>  the selected file is linked to the file with          ║
  8051.      ║                   this file number                                 ║
  8052.      ╚════════════════════════════════════════════════════════════════════╝
  8053.  
  8054.           The command SET LINK TO sets up a link between two files by
  8055.      record number.  After the link is set up between the selected file and
  8056.      another file, as the record pointer is moved in the selected file (for
  8057.      instance, with GO, FIND, or LIST), the record pointer in the other
  8058.      file is similarly moved.  If the selected file has more records, once
  8059.      the record number is too large for the other file, its current record
  8060.      number pointer will stay on the last record.
  8061.  
  8062.           SET LINK OFF turns off the linkage (if any) from the selected
  8063.      file.
  8064.  
  8065.           The command SET LINK TO temporarily "creates" data files with
  8066.      more than 32 fields from data files with such limits.  Data files
  8067.      which permanently have more than 32 fields can be created with the
  8068.      CREATE command.
  8069.  
  8070.           SET LINK TO can "chain" many files together.
  8071.  
  8072.      1>SET LINK TO 2
  8073.      1>SET#2 LINK TO 4
  8074.      1>SET#4 LINK TO 6
  8075.  
  8076.      links together the files 1, 2, 4, and 6.
  8077.  
  8078.           There can be only one SET LINK TO command from any one file.
  8079.  
  8080.      2>SET LINK TO 3
  8081.      2>SET LINK TO 4
  8082.  
  8083.      The second command overrules the first.
  8084.  
  8085.  
  8086.  
  8087.  
  8088.  
  8089.  
  8090.  
  8091.  
  8092.  
  8093.  
  8094.      SET LINK                   VPI1  VPI  VPIN                    SET LINK
  8095.      VP-Info Level 1 Reference Manual           Page 364          SECTION 4
  8096.  
  8097.  
  8098.           It is the user's responsibility to make sure that there are no
  8099.      "loops" such as in:
  8100.  
  8101.      1>SET LINK TO 2
  8102.      1>SELECT 2
  8103.      2>SET LINK TO 1
  8104.  
  8105.           If SET LINK is used, SET RELATION should be avoided.
  8106.  
  8107.  
  8108.  
  8109.  
  8110.  
  8111.  
  8112.  
  8113.  
  8114.  
  8115.  
  8116.  
  8117.  
  8118.  
  8119.  
  8120.  
  8121.  
  8122.  
  8123.  
  8124.  
  8125.  
  8126.  
  8127.  
  8128.  
  8129.  
  8130.  
  8131.  
  8132.  
  8133.  
  8134.  
  8135.  
  8136.  
  8137.  
  8138.  
  8139.  
  8140.  
  8141.  
  8142.  
  8143.  
  8144.  
  8145.  
  8146.  
  8147.  
  8148.  
  8149.  
  8150.  
  8151.      SET LINK                   VPI1  VPI  VPIN                    SET LINK
  8152.      VP-Info Level 1 Reference Manual           Page 365          SECTION 4
  8153.  
  8154.  
  8155.  
  8156.                                    SET MARGIN
  8157.  
  8158.      Specify text margin for printer.
  8159.  
  8160.      ╔════════════════════════════════════════════════════════════════════╗
  8161.      ║ SET MARGIN TO <num exp>                                            ║
  8162.      ║                                                                    ║
  8163.      ║ <num exp>   the margin                                             ║
  8164.      ╚════════════════════════════════════════════════════════════════════╝
  8165.  
  8166.           The command SET MARGIN sets the left margin for the printer.
  8167.      This command can be used in conjunction with any command that sends
  8168.      output to the printer.  See the commands SET PRINT ON, SET FORMAT TO
  8169.      PRINT, SET WIDTH, and TEXT.
  8170.  
  8171.           Example:
  8172.  
  8173.      SET PRINT ON
  8174.      SET MARGIN TO 5
  8175.      ? 'This is indented'
  8176.  
  8177.      Prints:
  8178.  
  8179.           This is indented.
  8180.  
  8181.  
  8182.  
  8183.  
  8184.  
  8185.  
  8186.  
  8187.  
  8188.  
  8189.  
  8190.  
  8191.  
  8192.  
  8193.  
  8194.  
  8195.  
  8196.  
  8197.  
  8198.  
  8199.  
  8200.  
  8201.  
  8202.  
  8203.  
  8204.  
  8205.  
  8206.  
  8207.  
  8208.      SET MARGIN                 VPI1  VPI  VPIN                  SET MARGIN
  8209.      VP-Info Level 1 Reference Manual           Page 366          SECTION 4
  8210.  
  8211.  
  8212.  
  8213.                                    SET MEMORY
  8214.  
  8215.      An obsolete command retained in the language for compatibility with
  8216.      earlier versions of VP-Info.
  8217.  
  8218.      ╔════════════════════════════════════════════════════════════════════╗
  8219.      ║ SET MEMORY TO <num const>                                          ║
  8220.      ║                                                                    ║
  8221.      ║ <num const>   the amount of memory reserved for high memory        ║
  8222.      ╚════════════════════════════════════════════════════════════════════╝
  8223.  
  8224.           This command is ignored in VP-Info Level 1. In VP-Info
  8225.      Professional, its role is taken by the MEMORY= command in the VPI.SET
  8226.      file.
  8227.  
  8228.  
  8229.  
  8230.  
  8231.  
  8232.  
  8233.  
  8234.  
  8235.  
  8236.  
  8237.  
  8238.  
  8239.  
  8240.  
  8241.  
  8242.  
  8243.  
  8244.  
  8245.  
  8246.  
  8247.  
  8248.  
  8249.  
  8250.  
  8251.  
  8252.  
  8253.  
  8254.  
  8255.  
  8256.  
  8257.  
  8258.  
  8259.  
  8260.  
  8261.  
  8262.  
  8263.  
  8264.  
  8265.      SET MEMORY                 VPI1  VPI  VPIN                  SET MEMORY
  8266.      VP-Info Level 1 Reference Manual           Page 367          SECTION 4
  8267.  
  8268.  
  8269.  
  8270.                                   SET NETWORK
  8271.  
  8272.      Specify the network.
  8273.  
  8274.      ╔════════════════════════════════════════════════════════════════════╗
  8275.      ║ SET NETWORK TO <num exp>                                           ║
  8276.      ║ SET NETWORK  ON/OFF                                                ║
  8277.      ║                                                                    ║
  8278.      ║ <num exp>   the network number                                     ║
  8279.      ╚════════════════════════════════════════════════════════════════════╝
  8280.  
  8281.           This command enables the user to LOCK and UNLOCK records on any
  8282.      network or multi-user system adhering to the standard conventions of
  8283.      Microsoft DOS 3.1 and above.
  8284.  
  8285.           The network calls are turned on with SET NETWORK TO 1 or SET
  8286.      NETWORK ON.
  8287.  
  8288.           The network calls are turned off with SET NETWORK TO 0 or SET
  8289.      NETWORK OFF.
  8290.  
  8291.           Caution:  Do not SET NETWORK ON when the SHARE command or your
  8292.      network's equivalent is not in effect, or run with SET NETWORK OFF while
  8293.      SHARE is in effect.  If you want to run VP-Info Professional Network
  8294.      Edition in both modes, start from different directories depending on
  8295.      whether the network is loaded.  Put SET NETWORK ON in the VPIN.CNF
  8296.      file in one directory, and SET NETWORK OFF in the other.
  8297.  
  8298.           Examples:
  8299.  
  8300.      1>SET NETWORK TO 1
  8301.      1>SET NETWORK TO 0
  8302.      1>SET NETWORK ON
  8303.  
  8304.  
  8305.  
  8306.  
  8307.  
  8308.  
  8309.  
  8310.  
  8311.  
  8312.  
  8313.  
  8314.  
  8315.  
  8316.  
  8317.  
  8318.  
  8319.  
  8320.  
  8321.  
  8322.      SET                        VPI1  VPI  VPIN                        SET
  8323.      VP-Info Level 1 Reference Manual           Page 368          SECTION 4
  8324.  
  8325.  
  8326.  
  8327.                                   SET RELATION
  8328.  
  8329.      Set up a relation between the selected file and another indexed data
  8330.      file.
  8331.  
  8332.      ╔════════════════════════════════════════════════════════════════════╗
  8333.      ║ SET RELATION ON <str exp> TO <num const>                           ║
  8334.      ║ SET RELATION OFF                                                   ║
  8335.      ║                                                                    ║
  8336.      ║ <str exp>      the key of the relation                             ║
  8337.      ║ <num const>    the relation is set between the selected file       ║
  8338.      ║                     and file <num const>                           ║
  8339.      ╚════════════════════════════════════════════════════════════════════╝
  8340.  
  8341.           <str exp> is an expression made up of fields (of character type)
  8342.      of the selected file, string constants, and string variables.
  8343.  
  8344.           Any time the current record pointer is changed for the selected
  8345.      file, <str exp> is evaluated, and a FIND is made with the result in
  8346.      the file <num const>.
  8347.  
  8348.           A file can be related to a number of other files: 1 is related to
  8349.      2, 1 is related to 3, 1 is related to 4 (file 1 has 3 fields on which
  8350.      additional information is available in files 2, 3, and 4); 1 is
  8351.      related to 2, 1 is related to 3, and 3 is related to 4 (the
  8352.      information linking 1 and 3 has additional data on file 4).
  8353.  
  8354.           Relations can also be chained: 1 is related to 2, 2 is related to
  8355.      3, and 3 is related to 4.
  8356.  
  8357.           However, only one file can SET RELATION TO a given file: you
  8358.      cannot have both 1 related to 6 and 2 related to 6.
  8359.  
  8360.           It is the user's responsibility to make sure that there is no
  8361.      loop, such as 1 related to 2, 2 related to 3, and 3 related to 1.
  8362.  
  8363.           To disable a relation, SET RELATION OFF, close either the
  8364.      selected file or the target file, of close the indexes on the target
  8365.      file.
  8366.  
  8367.           Examples:
  8368.  
  8369.      1>USE order
  8370.      1>USE#3 customer
  8371.      1>INDEX#3 ON cust:no TO customer
  8372.            3 RECORDS IN TOTAL INDEXED
  8373.      1>SET RELATION ON cust:no TO 3
  8374.      1>LIST order:no,fname#3,name#3
  8375.            1  10001  Robert          Steen
  8376.  
  8377.  
  8378.  
  8379.      SET RELATION               VPI1  VPI  VPIN                SET RELATION
  8380.      VP-Info Level 1 Reference Manual           Page 369          SECTION 4
  8381.  
  8382.  
  8383.      NO FIND
  8384.            2  10002
  8385.            3  10003  Joe             Smiths
  8386.      NO FIND
  8387.            4  10004
  8388.            5  10005  Robert          Steen
  8389.      1>SET RELATION OFF
  8390.  
  8391.           Note: the first order has CUST:NO 0050; this was found in the
  8392.      customer file, and the customer name was listed.  The second order has
  8393.      CUST:NO 105; there is no such customer in the customer file, so a NO
  8394.      FIND message is sent (this can be turned off in programs only with SET
  8395.      TALK OFF), and only the ORDER:NO was listed.
  8396.  
  8397.  
  8398.  
  8399.  
  8400.  
  8401.  
  8402.  
  8403.  
  8404.  
  8405.  
  8406.  
  8407.  
  8408.  
  8409.  
  8410.  
  8411.  
  8412.  
  8413.  
  8414.  
  8415.  
  8416.  
  8417.  
  8418.  
  8419.  
  8420.  
  8421.  
  8422.  
  8423.  
  8424.  
  8425.  
  8426.  
  8427.  
  8428.  
  8429.  
  8430.  
  8431.  
  8432.  
  8433.  
  8434.  
  8435.  
  8436.      SET RELATION               VPI1  VPI  VPIN                SET RELATION
  8437.      VP-Info Level 1 Reference Manual           Page 370          SECTION 4
  8438.  
  8439.  
  8440.  
  8441.                                    SET WIDTH
  8442.  
  8443.      Specify text width for printer.
  8444.  
  8445.      ╔════════════════════════════════════════════════════════════════════╗
  8446.      ║ SET WIDTH TO <num exp>                                             ║
  8447.      ║                                                                    ║
  8448.      ║ <num exp>     page width                                           ║
  8449.      ╚════════════════════════════════════════════════════════════════════╝
  8450.  
  8451.           The command SET WIDTH sets the page width (number of characters
  8452.      per line) for the TEXT and REPORT commands.  The WIDTH is the width of
  8453.      the text from the left margin; the default is 80.  So if the commands:
  8454.  
  8455.      SET MARGIN TO 10
  8456.      SET WIDTH TO 50
  8457.  
  8458.      are given, TEXT will wrap the words at character position 60.
  8459.  
  8460.           When a matrix variable is displayed, it is wrapped by the value
  8461.      set by SET WIDTH.
  8462.  
  8463.           The only aspect of a report that is affected by SET WIDTH TO is
  8464.      the number of characters over which its heading is positioned. It has
  8465.      no effect on the report columns themselves.
  8466.  
  8467.           See the commands SET MARGIN, SET PRINT ON, SET FORMAT TO PRINT,
  8468.      and TEXT.
  8469.  
  8470.           Examples:
  8471.  
  8472.           1. Program segment:
  8473.  
  8474.      SET WIDTH TO 40
  8475.      TEXT
  8476.      This is a nice long sentence to illustrate SET WIDTH.
  8477.      ENDTEXT
  8478.  
  8479.           Prints:
  8480.  
  8481.      This is a nice long sentence to
  8482.      illustrate SET WIDTH.
  8483.  
  8484.           2. Program segment:
  8485.  
  8486.      SET WIDTH TO 80
  8487.      TEXT
  8488.      This is a nice long sentence to illustrate SET WIDTH.
  8489.      ENDTEXT
  8490.  
  8491.  
  8492.  
  8493.      SET WIDTH                  VPI1  VPI  VPIN                   SET WIDTH
  8494.      VP-Info Level 1 Reference Manual           Page 371          SECTION 4
  8495.  
  8496.  
  8497.  
  8498.           Prints:
  8499.  
  8500.      This is a nice long sentence to illustrate SET WIDTH.
  8501.  
  8502.           3. Matrix variables:
  8503.  
  8504. 1>DIM NUM num[20]
  8505. 1>? num
  8506.       0.00       0.00       0.00       0.00       0.00       0.00       0.00
  8507.       0.00       0.00       0.00       0.00       0.00       0.00       0.00
  8508.       0.00       0.00       0.00       0.00       0.00       0.00
  8509. 1>SET WIDTH TO 30
  8510. 1>? num
  8511.       0.00       0.00       0.00
  8512.       0.00       0.00       0.00
  8513.       0.00       0.00       0.00
  8514.       0.00       0.00       0.00
  8515.       0.00       0.00       0.00
  8516.       0.00       0.00       0.00
  8517.       0.00       0.00
  8518.  
  8519.  
  8520.  
  8521.  
  8522.  
  8523.  
  8524.  
  8525.  
  8526.  
  8527.  
  8528.  
  8529.  
  8530.  
  8531.  
  8532.  
  8533.  
  8534.  
  8535.  
  8536.  
  8537.  
  8538.  
  8539.  
  8540.  
  8541.  
  8542.  
  8543.  
  8544.  
  8545.  
  8546.  
  8547.  
  8548.  
  8549.  
  8550.      SET WIDTH                  VPI1  VPI  VPIN                   SET WIDTH
  8551.      VP-Info Level 1 Reference Manual           Page 372          SECTION 4
  8552.  
  8553.  
  8554.  
  8555.                                       SKIP
  8556.  
  8557.      Move ahead or back in data file.
  8558.  
  8559.      ╔════════════════════════════════════════════════════════════════════╗
  8560.      ║ SKIP [<num exp>]                                                   ║
  8561.      ╟────────────────────────────────────────────────────────────────────╢
  8562.      ║ Option:                                                            ║
  8563.      ║                                                                    ║
  8564.      ║ <num exp>   by this many records; may be positive (forward) or     ║
  8565.      ║               negative (backward); default 1 record forward        ║
  8566.      ╚════════════════════════════════════════════════════════════════════╝
  8567.  
  8568.           The command SKIP moves the current record pointer ahead or back
  8569.      in the selected data file.
  8570.  
  8571.           SKIP by itself advances the record pointer to the next record.
  8572.  
  8573.           If you SKIP ahead more records than there are records left in the
  8574.      data file, then the current record becomes the last record.  Skipping
  8575.      past the last record sets the function EOF true.
  8576.  
  8577.           If you SKIP too many records back, the current record pointer
  8578.      will be set to 0.
  8579.  
  8580.           If there is an index file, ahead and back is understood in the
  8581.      indexed order.
  8582.  
  8583.           Examples:
  8584.  
  8585.      1>USE employee
  8586.      1>? #
  8587.           1.00
  8588.      1>SKIP
  8589.      1>? #,EOF
  8590.           2.00 F
  8591.      1>SKIP 5
  8592.      1>? #,EOF
  8593.           6.00 T
  8594.      1>SKIP -2
  8595.      1>? #,EOF
  8596.           4.00 F
  8597.      1>SKIP -10,EOF
  8598.      1>? #
  8599.           0.00 F
  8600.  
  8601.  
  8602.  
  8603.  
  8604.  
  8605.  
  8606.  
  8607.      SKIP                       VPI1  VPI  VPIN                        SKIP
  8608.      VP-Info Level 1 Reference Manual           Page 373          SECTION 4
  8609.  
  8610.  
  8611.  
  8612.                                       SORT
  8613.  
  8614.      Sort the selected data file into another data file.
  8615.  
  8616.      ╔════════════════════════════════════════════════════════════════════╗
  8617.      ║ SORT ON <str exp> TO <file>                                        ║
  8618.      ║                                                                    ║
  8619.      ║ <str exp>     the key of the sort                                  ║
  8620.      ║ <file>        the data file to contain the result of the sort      ║
  8621.      ╚════════════════════════════════════════════════════════════════════╝
  8622.  
  8623.           This command sorts the selected data file to the data file
  8624.      specified.  The sort is done by evaluating the <str exp>, creating a
  8625.      temporary index, and copying the file to <file>.
  8626.  
  8627.           Example:
  8628.  
  8629.      1>USE employee
  8630.      1>SORT ON name+fname TO empl2
  8631.  
  8632.           This is equivalent to the following:
  8633.  
  8634.      1>USE employee
  8635.      1>INDEX ON name+fname TO temp
  8636.      1>COPY TO empl2
  8637.  
  8638.           However, the second version has the advantage of allowing a field
  8639.      list and FOR clause, and output as an SDF file, none of which is
  8640.      available in SORT.
  8641.  
  8642.           For example, suppose the intention is to create a small, sorted
  8643.      data file with only name and address information on single employees
  8644.      for use by the company social club for a mailing about an upcoming
  8645.      event.
  8646.  
  8647.           The correct way to accomplish this is:
  8648.  
  8649.      1>USE employee
  8650.      1>INDEX ON name+fname TO temp FOR .NOT. married
  8651.      1>COPY TO empl2 FIELDS fname,name,addr,city,state,zip,tel_no
  8652.  
  8653.           See COPY and INDEX.
  8654.  
  8655.  
  8656.  
  8657.  
  8658.  
  8659.  
  8660.  
  8661.  
  8662.  
  8663.  
  8664.      SORT                       VPI1  VPI  VPIN                        SORT
  8665.      VP-Info Level 1 Reference Manual           Page 374          SECTION 4
  8666.  
  8667.  
  8668.  
  8669.                                      SOUND
  8670.  
  8671.      Use the computer speaker to generate a sound effect.
  8672.  
  8673.      ╔════════════════════════════════════════════════════════════════════╗
  8674.      ║ SOUND <numeric exp>                                                ║
  8675.      ║                                 VP-Info Professional only          ║
  8676.      ║                                                                    ║
  8677.      ║ <numeric exp>  the number of the sound required                    ║
  8678.      ╚════════════════════════════════════════════════════════════════════╝
  8679.  
  8680.           When effects are enabled (i.e., the NOEFFECTS keyword is not in
  8681.      the VPI.SET file), SOUND activates the computer speaker with one of a
  8682.      library of sounds effects.
  8683.  
  8684.           At publication time, there are 13 preprogrammed sound effects,
  8685.      numbered 1 through 13.  SOUND 0 terminates any sound. Values outside
  8686.      the range 0 through 13 are ignored.
  8687.  
  8688.           As naming the effects is not meaningful, VP-Info Professional
  8689.      users are urged to run the program example below and try all of them.
  8690.  
  8691.           Note that effect 2 continues until another sound is activated or
  8692.      SOUND 0 is executed; all other effects have defined duration.
  8693.  
  8694.           The command RING actually executes SOUND 7.
  8695.  
  8696.           Examples:
  8697.  
  8698.      1>SOUND 3
  8699.  
  8700.           A program to demonstrate all 13 effects:
  8701.  
  8702.      CLS
  8703.      REPEAT 13 TIMES VARYING effect
  8704.         @ 10,35 SAY 'Effect'+STR(effect,3)
  8705.         SOUND effect
  8706.         DELAY 1               ;timed pause
  8707.         SOUND 0               ;terminate sound if not self-terminating
  8708.      ENDREPEAT
  8709.  
  8710.  
  8711.  
  8712.  
  8713.  
  8714.  
  8715.  
  8716.  
  8717.  
  8718.  
  8719.  
  8720.  
  8721.      SOUND                          VPI  VPIN                         SOUND
  8722.      VP-Info Level 1 Reference Manual           Page 375          SECTION 4
  8723.  
  8724.  
  8725.  
  8726.                                      SPOOL
  8727.  
  8728.      Redirect printer output to disk file, or send disk file to printer.
  8729.  
  8730.      ╔════════════════════════════════════════════════════════════════════╗
  8731.      ║ Four forms:                                                        ║
  8732.      ║ 1.  SPOOL <filename>                                               ║
  8733.      ║ 2.  SPOOL                                                          ║
  8734.      ║ 3.  SPOOL <filename> TO <device> [PAGE <num exp>]                  ║
  8735.      ║ 4.  SPOOL/T                                                        ║
  8736.      ║                                                                    ║
  8737.      ╟────────────────────────────────────────────────────────────────────╢
  8738.      ║ Options:                                                           ║
  8739.      ║                                                                    ║
  8740.      ║ Form 1:      Create file <filename> and direct print output to     ║
  8741.      ║                that file; default extension TXT                    ║
  8742.      ║ Form 2:      Close any open spool file and stop redirection        ║
  8743.      ║ Form 3:      Do background printing of <filename> on <device>,     ║
  8744.      ║                usually PRN but can be any DOS device               ║
  8745.      ║     PAGE <num exp>  start printing on page <num exp>               ║
  8746.      ║ Form 4:      Stop background printint started with Firm 3          ║
  8747.      ╚════════════════════════════════════════════════════════════════════╝
  8748.  
  8749.           This command allows printer output to be captured into a disk
  8750.      file, and optionally spooled out to disk while other processing
  8751.      continues.  This command has four forms as follows:
  8752.  
  8753.                1.   Used with a filename, it creates a new spool file with
  8754.                     the name of filename (default extension TXT).
  8755.  
  8756.                2.   Used without a filename, SPOOL closes any open spool
  8757.                     file and restores printer as standard print device..
  8758.  
  8759.                3.   Used with both filename and device name, <filename> is
  8760.                     spooled to the specified DOS device, such as PRN, LPT1,
  8761.                     etc.  If PAGE option is used with a page number (can be
  8762.                     an expression) prinnting starts with the top of that
  8763.                     page number.
  8764.  
  8765.                4.   Used with a slash-T (/T), spooling is terminated. This
  8766.                     is same symbol as used with the DOS PRINT command for
  8767.                     the same purpose.
  8768.  
  8769.           If SPOOL is used to create a file, and a file already exists with
  8770.      that name, the user in Conversational VP-Info Level 1 is required to
  8771.      confirm that the file should be overwritten; in programs, the existing
  8772.      file is overwritten without prompting.
  8773.  
  8774.           Examples:
  8775.  
  8776.  
  8777.  
  8778.      SPOOL                      VPI1  VPI  VPIN                       SPOOL
  8779.      VP-Info Level 1 Reference Manual           Page 376          SECTION 4
  8780.  
  8781.  
  8782.  
  8783.      1>SPOOL reports
  8784.      1>REPORT custlist
  8785.      1>SPOOL
  8786.      1>SPOOL reports TO prn
  8787.  
  8788.  
  8789.  
  8790.  
  8791.  
  8792.  
  8793.  
  8794.  
  8795.  
  8796.  
  8797.  
  8798.  
  8799.  
  8800.  
  8801.  
  8802.  
  8803.  
  8804.  
  8805.  
  8806.  
  8807.  
  8808.  
  8809.  
  8810.  
  8811.  
  8812.  
  8813.  
  8814.  
  8815.  
  8816.  
  8817.  
  8818.  
  8819.  
  8820.  
  8821.  
  8822.  
  8823.  
  8824.  
  8825.  
  8826.  
  8827.  
  8828.  
  8829.  
  8830.  
  8831.  
  8832.  
  8833.  
  8834.  
  8835.      SPOOL                      VPI1  VPI  VPIN                       SPOOL
  8836.      VP-Info Level 1 Reference Manual           Page 377          SECTION 4
  8837.  
  8838.  
  8839.  
  8840.                                      STATUS
  8841.  
  8842.      Display status information.
  8843.  
  8844.      ╔════════════════════════════════════════════════════════════════════╗
  8845.      ║ STATUS                                                             ║
  8846.      ╚════════════════════════════════════════════════════════════════════╝
  8847.  
  8848.           If used in the interactive mode, this command displays two
  8849.      screens of information on the status of VP-Info Level 1.
  8850.  
  8851.           The first page lists the data files in use, the current record
  8852.      numbers, which file number is selected (marked by an asterisk), the
  8853.      expressions on which the index files had been indexed (the index file
  8854.      names are not shown).  In the example below, the lines:
  8855.  
  8856.      Rec #               File name       Indexed by
  8857.      0000008 *File 1 ... SALES.DBF       SALESMAN+PART , PART , DATE
  8858.  
  8859.      tell you that SALES.DBF is file 1; the asterisk shows that file 1 is
  8860.      selected; the current record number is 8; there are three index files,
  8861.      indexed by the expressions: SALESMAN+PART, PART, DATE.
  8862.  
  8863.           Next, you find the setting of all the flags; ON is show as Y, OFF
  8864.      as N.
  8865.  
  8866.           The "Total space left" message gives the number of bytes left in
  8867.      the 64K data space (see Appendix A).
  8868.  
  8869.           Level 1 can use 20 files altogether, of which only 16 are
  8870.      actually available to the user.  Other VP-Info users (DOS 3.3 and above)
  8871.      can have up to 50 files open at one time, provided FILES= commands are
  8872.      in both the CNF file and the CONFIG.SYS file in the root directory of
  8873.      the boot drive, and both call for at least that number of files.
  8874.      "Files in use" shows how many are being used; you can infer how many
  8875.      are still available (16-4=12 in the standard setting, 46-4=42 if
  8876.      FILES=50).
  8877.  
  8878.           "High memory remaining" is the number of bytes available for use
  8879.      by matrix variables and background-screen storage.
  8880.  
  8881.           "Width" and "Left margin" show the most recent setting by SET
  8882.      WIDTH and SET MARGIN, respectively, or the default.
  8883.  
  8884.           In the example shown below, the top line shows NETWORK ON; when
  8885.      not on, or when not using VP-Info Professional Network Edition, this
  8886.      message is omitted.  When SET NETWORK ON and data files are opened
  8887.      with file modes (READ, WRITE, LOCK, or SHARE), the first letter of the
  8888.      mode is shown immediately before the index expressions.
  8889.  
  8890.  
  8891.  
  8892.      STATUS                     VPI1  VPI  VPIN                      STATUS
  8893.      VP-Info Level 1 Reference Manual           Page 378          SECTION 4
  8894.  
  8895.  
  8896.  
  8897.           The second page of the STATUS display is the same as the listing
  8898.      produced by the command LIST MEMORY.
  8899.  
  8900.           If STATUS is a command in a program, the execution of the program
  8901.      stops, the user can view the two screens, and then program execution
  8902.      resumes.  In this use of STATUS, the first page also shows the name of
  8903.      the current program.
  8904.  
  8905.           Example:
  8906.  
  8907.           Give the commands:
  8908.  
  8909.  
  8910.      1>number=21
  8911.      1>name='David'
  8912.      1>USE sales INDEX sales,part,date
  8913.      1>STATUS
  8914.  
  8915.           The display:
  8916.  
  8917. ──────────────────────────────────────────────────────────────────────────────
  8918. Thursday, March 22, 1990            VP-Info STATUS                 NETWORK ON
  8919.  
  8920. Rec #               File name       Indexed by
  8921. 0000001 *File 1 ... SALES.DBF       W SALENUM , PARTNUM , DATE
  8922. 0000000  File 2 ...
  8923. 0000000  File 3 ...
  8924. 0000000  File 4 ...
  8925. 0000000  File 5 ...
  8926. 0000000  File 6 ...
  8927. 0000000  File 7 ...
  8928. 0000000  File 8 ...
  8929. 0000000  File 9 ...
  8930. 0000000  File 10 ...
  8931. ┌────────────┬────────────┬────────────┬────────────┬───────────┬────────────┐
  8932. │ Add...... N│ Delete... N│ End...... Y│ Heading.. N│ Print... N│ Step..... N│
  8933. │ Alternate N│ Delim.... N│ Error.... Y│ Intensity Y│ Prompt.. N│ Talk..... Y│
  8934. │ Bell..... N│ Display.. Y│ Escape... Y│ Keep..... Y│ Raw..... N│ Text..... N│
  8935. │ Carry.... N│ Divzero.. Y│ Exact.... N│ Line..... Y│ Save.... Y│ Trim..... Y│
  8936. │ Confirm.. N│ Do....... Y│ Execute.. Y│ Lock..... N│ Screen.. Y│ Upper.... N│
  8937. │ Console.. Y│ Echo..... N│ Function. Y│ Menu..... Y│ Snow.... Y│ Zero..... Y│
  8938. │ Debug.... N│ Eject.... Y│ Get...... N│ Mono..... Y│           │            │
  8939. └────────────┴────────────┴────────────┴────────────┴───────────┴────────────┘
  8940. Program .............. GENERAL.PRG      Files in use ......... 1
  8941. Memory remaining ..... 23490            High memory remaining. 39744
  8942. Width................. 80               Left margin .......... 0
  8943. ──────────────────────────────────────────────────────────────────────────────
  8944.  
  8945.  
  8946.  
  8947.  
  8948.  
  8949.      STATUS                     VPI1  VPI  VPIN                      STATUS
  8950.      VP-Info Level 1 Reference Manual           Page 379          SECTION 4
  8951.  
  8952.  
  8953.  
  8954.                                      STORE
  8955.  
  8956.      Assign value to a memory variable.
  8957.  
  8958.      ╔════════════════════════════════════════════════════════════════════╗
  8959.      ║ STORE <exp> TO <memvar>                                            ║
  8960.      ║                                                                    ║
  8961.      ║ <exp>      the value assigned                                      ║
  8962.      ║ <memvar>   name of memory variable                                 ║
  8963.      ╚════════════════════════════════════════════════════════════════════╝
  8964.  
  8965.           This command assigns a value to a memory variable; if the
  8966.      variable does not exist, it will be created.  An equivalent way of
  8967.      assigning value is with the = command.
  8968.  
  8969.           See the command =.
  8970.  
  8971.           Examples:
  8972.  
  8973.      1>STORE 3 TO b
  8974.      1>STORE 5*b TO c
  8975.      1>? c
  8976.          15.00
  8977.  
  8978.  
  8979.  
  8980.  
  8981.  
  8982.  
  8983.  
  8984.  
  8985.  
  8986.  
  8987.  
  8988.  
  8989.  
  8990.  
  8991.  
  8992.  
  8993.  
  8994.  
  8995.  
  8996.  
  8997.  
  8998.  
  8999.  
  9000.  
  9001.  
  9002.  
  9003.  
  9004.  
  9005.  
  9006.      STORE                      VPI1  VPI  VPIN                       STORE
  9007.      VP-Info Level 1 Reference Manual           Page 380          SECTION 4
  9008.  
  9009.  
  9010.  
  9011.                                       SUM
  9012.  
  9013.      Sum numeric expressions for selected records.
  9014.  
  9015.      ╔════════════════════════════════════════════════════════════════════╗
  9016.      ║ SUM [<scope>] <num exp list> [TO <memvar list>] [FOR <cond>]       ║
  9017.      ║                                                                    ║
  9018.      ║ <num exp list>    the numeric expressions to sum                   ║
  9019.      ╟────────────────────────────────────────────────────────────────────╢
  9020.      ║ Options:                                                           ║
  9021.      ║                                                                    ║
  9022.      ║ <scope>           select by scope (default scope: ALL)             ║
  9023.      ║ <memvar list>     store the results in these memory variables      ║
  9024.      ║ FOR <cond>        select by condition                              ║
  9025.      ╚════════════════════════════════════════════════════════════════════╝
  9026.  
  9027.           The command SUM adds up numeric expressions for selected records
  9028.      of the selected data file.  Up to 10 expressions can be summed with
  9029.      one command.  Optionally, the results can be stored in numeric memory
  9030.      variables; the expression list and the numeric memory variable list
  9031.      must have the same number of entries.  <memvar list> cannot contain
  9032.      numeric matrix variables.
  9033.  
  9034.           Records flagged as DELETED are not summed.  See also AVERAGE,
  9035.      COUNT, MIN, and MAX.
  9036.  
  9037.           Example:
  9038.  
  9039.           The total payroll of the company presently, and after a 5% raise:
  9040.  
  9041.      1>USE employee
  9042.      1>SUM salary, salary*1.05
  9043.            6 SUM(S)
  9044.      191980 201579
  9045.      1>SET TALK OFF
  9046.      1>SUM salary,salary*0.05 TO sal,salincr
  9047.      1>? sal,salincr
  9048.      191980 201579
  9049.  
  9050.  
  9051.  
  9052.  
  9053.  
  9054.  
  9055.  
  9056.  
  9057.  
  9058.  
  9059.  
  9060.  
  9061.  
  9062.  
  9063.      SUM                        VPI1  VPI  VPIN                         SUM
  9064.